Welcome Guest, Not a member yet? Register   Sign In
Extending CI_Controller
#1

[eluser]boytun[/eluser]
Hello
In my application I use HMVC structure, so i try ti extand the MX_Controller with CI_Controller, so that I can load my modules in the mvc views.
I try this:
In the core folder

Code:
class MX_Controller extends MY_Controller {

public function index()
{
  
}

}

Code:
class MY_Controller extends CI_Controller {

public function __construct()
{
  parent::__construct();
}

public function index()
{
  
}

}

In the librairies folder

Code:
class Frontend_Controller extends MY_Controller {

public function __construct()
{

}

}

In the controllers folder

Code:
class Article extends Frontend_Controller {

public function __construct()
{
  parent::__construct();
}

public function index()
{
$this->load->view('myview');
}

}

In the view folder (myview.php')
Code:
<?php echo Modules::run('tasks') ; ?>

the tasks module is juste contains a echout sentence in the HMVC view

But I get this error
Fatal error: Cannot redeclare class CI in C:\xampp\htdocs\application\third_party\MX\Base.php on line 57

Please I need your Help
Thanks in advance


Messages In This Thread
Extending CI_Controller - by El Forum - 04-06-2013, 07:27 AM
Extending CI_Controller - by El Forum - 04-07-2013, 02:09 AM
Extending CI_Controller - by El Forum - 04-07-2013, 02:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB