forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
CLE Controller Loader Extension
Derek Jones edited this page Jul 5, 2012
·
8 revisions
Controller Loader Extension - allows to work with your controllers within other controllers just the same as you would work with libraries
PHP5 Start with a clean CI install. Place Files from File:CLE.zip archive into your /application/libraries folder. Maker sure class preffix constant is 'MY' or change file names and class name according to your prefix All you must to do is to extend your controllers from MY_PageController instead of Controller and set constructor method to parent::getInstance() as follows ```phpclass Welcome extends MY_PageController {
public function __construct()
{
parent::getInstance();
}
}
Load and work with other controllers just the same you would do with your libraries:
```php
class Demo extends MY_PageController {
public function __construct()
{
parent::getInstance();
}
public function index()
{
$this->load->controller('Welcome');
$this->welcome->index();
}
}