![]() |
Need Help With Modular Extensions - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Need Help With Modular Extensions (/showthread.php?tid=35922) Pages:
1
2
|
Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]php_wizardry[/eluser] Ok, I have installed ME and trying to build a modular CMS. However, things aren't going well for me. Here are the errors I have: A PHP Error was encountered Severity: Notice Message: Undefined property: Admin::$parser Filename: MX/Loader.php Line Number: 143 A PHP Error was encountered Severity: Notice Message: Undefined property: Theme_module::$theme_model Filename: controllers/theme_module.php Line Number: 19 Fatal error: Call to a member function get_page_info() on a non-object in C:\xampp\htdocs\cms\system\application\modules\theme\controllers\theme_module.php on line 19 I am trying to load the info as I normally would with CI such as:$this->load->library('parser'); and $this->load->model('theme/theme_model'); Can anyone please tell me what I am doing wrong. I am pretty sure this is allowed from what I have read in the docs. Thanks. Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]wiredesignz[/eluser] Post some code man, the errors means nothing without seeing your code. Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]php_wizardry[/eluser] Here is the controller calling the theme module: Code: <?php Then here is the controller for the theme module Code: <?php Then the model for the theme module Code: <?php Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]wiredesignz[/eluser] Ok you are using HMVC features of Modular Extensions by loading modules so your controllers need to extend the MX_Controller class. Try that first. Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]php_wizardry[/eluser] Extending the MX_Controller on the theme module controller, I now get this error: Fatal error: Cannot redeclare class CI in C:\xampp\htdocs\cms\system\application\third_party\MX\Base.php on line 76. BTW, thanks for the help. ![]() Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]wiredesignz[/eluser] Extend MX_Contoller in all controllers. You're not even loading a module in the Theme controller. You are in the Admin controller. Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]php_wizardry[/eluser] ![]() ![]() Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]wiredesignz[/eluser] No worries. You must extend MX_Controller whenever loading modules or using modules::run Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]php_wizardry[/eluser] Also, what do you mean by not loading a module in theme? theme is the module. am I not using the way this was intended? pretty much what I wanted to do, was create a cms that uses modules so that I could drop modules in and then a coder/user could integrate the module into the cms pretty easily. Not exactly plug n play but more of using a cms to customize an already built module. ![]() Need Help With Modular Extensions - El Forum - 11-15-2010 [eluser]wiredesignz[/eluser] I meant the main controller (Admin) needs to extend MX_Controller more so than the module controller itself. You had it backwards for a moment by extending the Theme controller and not Admin. The main controller needs to be able to locate the module controller properly and MX_Controller allows this. It does not hurt to always extend MX_Controller in any case. |