forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 26
CLE Controller Loader Extension
World Wide Web Server edited this page Jul 4, 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 File from CLE 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 [code] class Welcome extends MY_PageController { public function __construct() { parent::getInstance(); } } [/code]
- Load and work with other controllers just the same you would do with your libraries:
[code]
class Demo extends MY_PageController {
public function __construct()
{
parent::getInstance();
}
public function index() { $this->load->controller('Welcome'); $this->welcome->index(); }} [/code]