Need some help with HMVC |
[eluser]Unknown[/eluser]
Hi, I'm trying to find out how HMVC works and how i can build modules with this extension. But it will not work. At the moment i have the following PHP error: "PHP Fatal error: Cannot redeclare class CI" This is what I'm trying to do: I have a controller (application/controllers/aController.php) that looks like this: Code: class aController extends CI_Controller{ And this is the code of my test module (application/modules/test/controllers/test.php Code: class Test extends MX_Controller { when i visit http://localhost/test it works fine, but i can't add the module to the output of a normal controller. When i visit http://localhost/aController.php i get a blank page with the error of above in my logs. What am i doing wrong?
[eluser]porquero[/eluser]
If you use hmvc, I recommend don't use /application/controllers directory anymore. Always use modules drectory and all you controllers must extends MX_Controller.
[eluser]Unknown[/eluser]
Ok. But how can make use of a main template when i build my pages only with modules?
[eluser]porquero[/eluser]
Well you can use Decorator Design Pattern. For more information see: http://porquero.blogspot.com/2012/02/codeigniter-work-with-template-views.html |
Welcome Guest, Not a member yet? Register Sign In |