Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Codeigniter template library and HMVC ( mx library ) the static method run()
- <?php
- class Test extends MX_Controller {
- public function __construct()
- {
- parent::__construct();
- $this->template->title($this->config->item('site_name','app'));
- }
- public function index()
- {
- $this->template->build('index');
- }
- }
- <?php
- //ms module
- class Msrofi extends MX_Controller {
- public function __construct()
- {
- parent::__construct();
- $this->template->title($this->config->item('site_name','app'));
- }
- public function index()
- {
- $t = Modules::run('test/test/index');
- var_dump($t);
- $this->template->build('index_message');
- }
- }
- class Test extends MX_Controller {
- public function index()
- {
- // This path works only from the "test" module
- // $this->template->build('index');
- // This path works from any module
- $this->template->build('test/index');
- }
- }
- ob_start();
- Modules::run('test/test/index');
- $t = ob_get_clean();
- var_dump($t);
Add Comment
Please, Sign In to add comment