Part of the EllisLab Network
   
11 of 12
11
Modular Extensions - (HMVC) - Version 2.1.8
Posted: 25 February 2008 08:26 AM   [ Ignore ]   [ # 101 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  282
Joined  12-25-2007

Modules is only a static helper class, it isn’t meant to be instantiated. The HMVC class is extended by your module… I suppose it could be called Module.

One last thing… I’m not sure if the Modular Extensions is just a helper or it is a library. For me, it is a library that have a helper inside. Even more, it is in the same level of Controller and Model libraries. In my opinion, it should go to “application/libraries”, with the name “Module.php”.

 Signature 

Oh God… Why didn’t you show me CodeIgniter before?

Profile
 
 
Posted: 25 February 2008 01:32 PM   [ Ignore ]   [ # 102 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  770
Joined  02-06-2007
Edemilson Lima - 25 February 2008 01:26 PM

Modules is only a static helper class, it isn’t meant to be instantiated. The HMVC class is extended by your module… I suppose it could be called Module.

One last thing… I’m not sure if the Modular Extensions is just a helper or it is a library. For me, it is a library that have a helper inside. Even more, it is in the same level of Controller and Model libraries. In my opinion, it should go to “application/libraries”, with the name “Module.php”.

If it was a library, then CI would instantiate it when it’s loaded. That doesn’t make sense. If you want to make it a true CI helper instead of a static class then change the methods. For example:

- run() becomes modules_run()
- so to call it, modules::run() becomes modules_run()

 Signature 

“I am the terror that flaps in the night”

Profile
 
 
Posted: 25 February 2008 02:20 PM   [ Ignore ]   [ # 103 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  282
Joined  12-25-2007

In my view, a helper is a standalone function and a library is a set of functions or classes that work together. It doesn’t matter if it can be instantiated or not, unless the library concept in CI only applies to intantiable classes. Anyway, I do prefer to use modules::run() than modules_run(). smile

By the way, what do you think about the version 3.0? Is it more a library than a helper or not?

http://codeigniter.com/forums/viewthread/72580/

 Signature 

Oh God… Why didn’t you show me CodeIgniter before?

Profile
 
 
Posted: 01 October 2008 02:39 AM   [ Ignore ]   [ # 104 ]  
Grad Student
Rank
Total Posts:  49
Joined  04-29-2008

Hi, sorry to post in a old thread, just wondered if any experts here could help me with a problem which I have with HMVC? Details of the problems and description here:
http://codeigniter.com/forums/viewthread/92383/

Many thanks in advance! smile

Profile
 
 
Posted: 25 November 2009 10:52 AM   [ Ignore ]   [ # 105 ]  
Summer Student
Total Posts:  21
Joined  12-19-2008

I’m getting this error

Unable to load the requested filenesto.php 

when am trying this code

$this->load->view('nesto'$this->_data); 

this is my dir stricture http://twitpic.com/qvgys

Can anyone tell me what am doing wrong?

 Signature 

Sorry my English
My Blog

Profile
 
 
Posted: 10 March 2011 11:12 AM   [ Ignore ]   [ # 106 ]  
Summer Student
Total Posts:  2
Joined  06-29-2010

Hello,

i’m trying to use the controller variables in the view (as I do in the CI 2.0 basic installation) with the HMVC extensions.

Controller:

class MY_Controller extends MX_Controller{

    
var $table;
    
    function 
__construct()
    
{
          parent
::__construct();
          
$this->table "foo"

View:

<?php echo $this->table ?> 

This simply doesn’t work. Any suggestion is highly appreciated.
Thank you

Filippo

Profile
 
 
Posted: 16 March 2011 11:09 PM   [ Ignore ]   [ # 107 ]  
Summer Student
Total Posts:  28
Joined  11-16-2010

removed

Profile
 
 
Posted: 17 March 2011 05:46 AM   [ Ignore ]   [ # 108 ]  
Summer Student
Total Posts:  2
Joined  06-29-2010

Hi all,
i’d like to clarify that my problem arises only when the HMVC extensions are installed. on CI2.0 I can normally use controller variables in the view. after HMVC I can’t.
So, if not depending on something I did, this is an HMVC issue.

Regards,
Filippo

Profile
 
 
Posted: 17 March 2011 06:02 AM   [ Ignore ]   [ # 109 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  3216
Joined  06-10-2007

The object represented by “$this” in a view is actually the CI_Loader object not the CI_Controller. The CI core objects are assigned to the Loader when your view is loaded. This is a coding problem because there may be more than one controller in existence at any time, references to variables in the view will be to the CI core objects.

EDIT:
I have updated Modular Extensions HMVC on bitbucket to allow $this->variable in a view to reference the current module controller.

However it is far better practice to pass variables to your views as recommended and detailed in the CodeIgniter User Guide.

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

Profile
 
 
Posted: 17 March 2011 06:54 AM   [ Ignore ]   [ # 110 ]  
Summer Student
Total Posts:  28
Joined  11-16-2010

hi, wiredesignz
i encounter some problem in HMVC, only in some circumstances.

here the link http://codeigniter.com/forums/viewthread/121820/P290/#869780

wink

Profile
 
 
   
11 of 12
11