HMVC not working trying to show view partial in CI 3.1.4 |
Hello, I started using HMVC today (https://bitbucket.org/wiredesignz/codeig...sions-hmvc) and I've got to put the code to work as a module modifying MX_Loader (there was a missing function so I read), but when I tried to show the module as a view partial I get this error "Fatal error: Cannot redeclare class CI in C:\Datos\www\gastronegocios\application\third_party\MX\Base.php on line 57". This is my code:
Module Controller PHP Code: class Ivanblue extends MX_Controller { Module View Code: <p> When I go to the controller directly at "http://localhost/gastronegocios/ivanblue" it works perfectly, but when I try to use it as a view partial I get the error "Fatal error: Cannot redeclare class CI in C:\Datos\www\gastronegocios\application\third_party\MX\Base.php on line 57". This is how I'm trying to show it as a view partial, inside a normal view: Code: html code... How can I get this working? Thanks in advance.
Hello, I found the solution. It was that my Home controller also should extend MX_Controller, not just the controllers at the modules folder. This is a really useful feature to have.
Thanks!
The best way is to create a MY_Controller extending the MX_Controller
then extend all of your controllers from the MY_Controller. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |