Load module in the view |
[eluser]boytun[/eluser]
Hello I need to load my module into my application's view, but I can't. My module work fun if I excuted from localhost/mymodule, but if I call It from the view(echo Modules::run('mymodule')) I get this: Code: Cannot redeclare class CI in C:\xampp\htdocs\application\third_party\MX\Base.php on line 57 Code: application/ Thanks in advance.
[eluser]Otemu[/eluser]
Hi, Have you followed the guide here Ensure you have done the following: Quote:To use HMVC functionality, such as Modules::run(), controllers must extend the MX_Controller class.
[eluser]boytun[/eluser]
I extend all my controller with MX_Controller like this: Code: application/ but I get a page full of errors
[eluser]TheFuzzy0ne[/eluser]
Frontend_Controller should extend MX_Controller. MX_Controller should extend MY_Controller. MY_Controller should extend CI_Controller.
[eluser]wiredesignz[/eluser]
@fuzzy, no sorry. The CI_Controller class cannot be used if you require the HMVC features of Modular Extensions HMVC. All controllers must extend the MX_Controller class. You may only extend the CI_Controller class if you wish to use the module directory structure without using HMVC. In that case you must also specify which "module/resource" you wish to load within your controllers.
[eluser]boytun[/eluser]
Through the post of wiredesignz, my structure became like this: Code: application/ Quote:A PHP Error was encountered Quote:A PHP Error was encountered Quote:A PHP Error was encountered And many others
[eluser]TheFuzzy0ne[/eluser]
@wiredesignz Apologies. Of course, what you're saying makes complete sense. MX_Controller extends nothing. It's a replacement for CI_Controller. As soon as I can think up a suitable project, I'll be having a play with HMVC. Thanks! |
Welcome Guest, Not a member yet? Register Sign In |