EllisLab text mark
Advanced Search
3 of 23
3
   
Modular Extensions - HMVC version 5.4
Posted: 21 April 2011 01:20 PM   [ Ignore ]   [ # 41 ]   [ Rating: 0 ]
Joined: 2010-12-23
13 posts

whats the version of CI you use???

 
Posted: 21 April 2011 01:35 PM   [ Ignore ]   [ # 42 ]   [ Rating: 0 ]
Joined: 2010-01-28
40 posts

Newest CI & ME HMVC. Just downloaded and set them up a few days ago

 
Posted: 21 April 2011 01:46 PM   [ Ignore ]   [ # 43 ]   [ Rating: 0 ]
Joined: 2010-12-23
13 posts

did you inherited my_lang like this inside core?

require APPPATH.“third_party/MX/Lang.php”;

class MY_Lang extends MX_Lang {}

 
Posted: 21 April 2011 01:52 PM   [ Ignore ]   [ # 44 ]   [ Rating: 0 ]
Joined: 2010-01-28
40 posts

Yes I did.  In fact, even with my workaround I still have to do that.

 
Posted: 22 April 2011 12:01 AM   [ Ignore ]   [ # 45 ]   [ Rating: 0 ]
Joined: 2010-11-16
30 posts

hi, has every one try the latest code from codeigniter reactor 2011 04 22 ?

A PHP Error was encountered

Severity
Notice

Message
Undefined propertyCI::$_ci_cached_vars

Filename
MX/Loader.php

Line Number
265 
 
Posted: 22 April 2011 05:34 AM   [ Ignore ]   [ # 46 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-15
148 posts

All the properties in the core Loader library are now protected, HMVC doesn’t work because of this.
I know changing the core is not a good solution, but the only 2 solutions are:
1. Go to an older CI version, 2.0.2 should work fine
2. Change the Loader library in system/core/Loader.php:

public $_ci_ob_level;
public 
$_ci_view_paths        = array();
public 
$_ci_library_paths    = array();
public 
$_ci_model_paths        = array();
public 
$_ci_helper_paths    = array();
public 
$_base_classes        = array(); // Set by the controller class
public $_ci_cached_vars        = array();
public 
$_ci_classes            = array();
public 
$_ci_loaded_files    = array();
public 
$_ci_models            = array();
public 
$_ci_helpers            = array();
public 
$_ci_varmap            = array('unit_test' => 'unit'
                                        
'user_agent' => 'agent'); 

It’s a quick and dirty fix, but it works wink

 Signature 

http://www.creolab.hr/

 
Posted: 25 April 2011 04:49 AM   [ Ignore ]   [ # 47 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

Pushed an update to Bitbucket to resolve $_ci_cached_vars error. Further updates to follow.

 Signature 

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

 
Posted: 25 April 2011 06:15 AM   [ Ignore ]   [ # 48 ]   [ Rating: 0 ]
Avatar
Joined: 2011-01-31
384 posts

Tried to use your last update and I got these errors:

Fatal errorAccess level to MX_Loader::_ci_load() must be public (as in class CI_Loaderin E:\web\ci_test\application\third_party\MX\Loader.php on line 378 

turning _ci_load to public produces

Fatal errorAccess level to MX_Loader::_ci_get_component() must be public (as in class CI_Loaderin E:\web\ci_test\application\third_party\MX\Loader.php on line 378 

And if _ci_get_component is turned to public everything seems to work as expected in a vanilla installation.

 Signature 

NetID

 
Posted: 25 April 2011 06:45 AM   [ Ignore ]   [ # 49 ]   [ Rating: 0 ]
Joined: 2010-11-16
30 posts

gonna try new code after i complete a module i am working on.

 
Posted: 25 April 2011 06:46 AM   [ Ignore ]   [ # 50 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@osci, Yes thanks, that will be a Reactor and Core CI version conflict too. Reactor is using protected methods. I will update again to use public methods.

 Signature 

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

 
Posted: 25 April 2011 08:18 AM   [ Ignore ]   [ # 51 ]   [ Rating: 0 ]
Avatar
Joined: 2011-01-31
384 posts

Thanks for the info wiredesignz.
I am basically using core for my commercial projects.
I’ll check it there too and repost.

The vanilla test was on reactor since I wanted to check my projects on reactor too.
I know I might be asking too much but could we have another branch for reactor and another for core?

Thanks again for your contributions.

 Signature 

NetID

 
Posted: 25 April 2011 04:13 PM   [ Ignore ]   [ # 52 ]   [ Rating: 0 ]
Joined: 2010-01-28
40 posts

Hi wiredesignz, was I wrongly extending MX_Lang or is there not a native way to extend that with HMVC?  Also, is there a bug with $this->router->fetch_module() not always returning the correct module in different contexts?

 
Posted: 25 April 2011 10:00 PM   [ Ignore ]   [ # 53 ]   [ Rating: 0 ]
Joined: 2011-01-06
16 posts

Hi! I’m starting to learn HMVC and I really think that it can do wonders. It might be what I need to actually create an admin-member-non-member website.

I’m just running encountering a problem. It seems there’s a problem with calling HMVC from the view. I’m currently following the Net Tuts HMVC: an introduction and application. Let me explain:

Here are the functions:

THE CONTROLLER FUNCTION UNDER “LOGIN” MODULE:

function cp()  
{  
    
if( $this->session->userdata('username') )  
    
{  
        
// load the model for this controller  
        
$this->load->model('membership_model');  
        
// Get User Details from Database  
        
$user $this->membership_model->get_member_details();  
        if( !
$user )  
        
{  
            
// No user found  
            
return false;  
        
}  
        
else  
        
{  
            
// display our widget  
            
$this->load->view('user_widget'$user);  
        
}  
    }  
    
else  
    
{  
        
// There is no session so we return nothing  
        
return false;  
    
}  

and

THE VIEW UNDER THE “SITE” MODULE:

<!DOCTYPE html>  
<
html lang="en">  
<
head>  
    <
meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
    <
title>untitled</title>  
</
head>  
<
body>  
    
<?php echo modules::run('modules/login/cp');?>  
    
<h2>Welcome Back<?php echo $this->session->userdata('username'); ?>!</h2>  
     <
p>This section represents the area that only logged in members can access.</p>  
</
body>  
</
html

THE PROBLEM:

I can’t seem to call cp() from the view using <?php echo modules::run(‘modules/login/cp’);?>. It doesn’t produce the user_widget. If I change the function called in the view (i.e. <?php echo modules::run(‘modules/login/RANDOMFUNCTION’);?>), it don’t get an error.

If I remove the “modules” from the path (as in the original code in the article - <?php echo modules::run(‘login/cp’);?>), I get an error:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Login::$session

Filename: controllers/login.php

Line Number: 91

Is there something wrong with the code? I followed the guide to the letter except when I had to edit the module::run call from module::run(‘login/cp’) to module::run(‘modules/cp’) to follow the format specified:

Format: modules::run(‘module/controller/action’, $param1, $param2, .., $paramN);

 
Posted: 25 April 2011 10:02 PM   [ Ignore ]   [ # 54 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@wilso417, MY_Lang should be located in application/core and should extend MX_Lang. The error with CI_Controller needs to be resolved as a separate issue.

MX_Router::fetch_module() returns the name of the last module controller loaded.

 Signature 

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

 
Posted: 25 April 2011 10:06 PM   [ Ignore ]   [ # 55 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@eldrinofsoalim, Don’t use the word “modules” use the name of your module. The error with Login::$session needs to be resolved as a separate issue.

 Signature 

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

 
3 of 23
3