I'm trying out codeIgniter and the Modular Extension. So far I followed the installation instructions from wiredesignz on bitbucket. Now I'm trying the tutorial HMVC: an Introduction and Application from NetTuts.
I'm doing this with the actual version of CodeIgniter 2.1 and the actual version of the Modular Extension (downloaded the .zip version from bitbucket).
All works fine until I'm trying to run a method from a controller of another module.
The setup in short is, that there's two modules (site & login). Within the site's controllers there's site.php (/modules/site/controllers/site.php
) with a method that checks if a user is logged in. This method would exit the script execution if accessing the site without being logged in. As this method logically belongs to the login module, the author suggests moving it there. So it then is moved to /modules/login/controllers/login.php
.
The problem now is, how to access the method of the login module from within the site module. The slightly adjusted code from the tutorial:
// modules/site/controllers/site.php
function __construct()
{
// parent::Controller();
// replaced with:
parent::__construct();
// modules::run('login/is_logged_in');
// replaces with:
$this->load->module('login')->is_logged_in();
}
Like this I'm getting an error:
Unable to load the requested file: logged_in_area.php
The method in question is inside the site module as well:
// modules/site/controllers/site.php
function members_area()
{
$this->load->view('logged_in_area');
}
The Script executes right until the load->view
line and produces the error. There's no problem accessing the logged_in_area.php
with running the is_logged_in
method from within the site controller with the line:
$this->is_logged_in();
Any ideas?
edit:
the application tree:
/application
/...
/modules
/login
/controllers
login.php
/models
/views
login_form.php
signup_form.php
signup_successful.php
/site
/controllers
site.php
/models
membership_model.php
/views
logged_in_area.php
PS: How can I get more INformation about the error? CodeIgniter seems to be very reserved about error output ...