Skip to content

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

Controller Loader Extension requirements:

PHP5

Controller Loader Extension installation:

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

Controller Loader Extension Usage:

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 ```php

class 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();
      }
}

Clone this wiki locally