![]() |
Load a controller from a library HMVC - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Load a controller from a library HMVC (/showthread.php?tid=59627) |
Load a controller from a library HMVC - El Forum - 10-29-2013 [eluser]vdecaux83[/eluser] Hello everybody ! I try to develop a kind of "hook" system. I want to load in my Template library some controllers functions. So I did this function : Code: function hookTop() And I have in my config item the list of modules containing a "hookTop" function. But I have this error : Quote:Fatal error: require(): Cannot redeclare class ci in /var/www/preprod/toolbox/application/third_party/MX/Controller.php on line 4 I am using HMVC module (version 5.4), and my controller extends MX_CONTROLLER. Does anyone else have this error? Is this possible to do? Thanks ! Load a controller from a library HMVC - El Forum - 10-30-2013 [eluser]vdecaux83[/eluser] I really didn't find anything about my question... There is no way to get a controller function from a library ? Is this possible to show a HTML view from a library ? Load a controller from a library HMVC - El Forum - 10-30-2013 [eluser]vdecaux83[/eluser] Ok I get it ! I simply use a require_once.. Not the best way I think, but it works ! Code: $output = ''; In this way, I can load controller function and enable hook in my template ! Pretty smart with HMVC ![]() Load a controller from a library HMVC - El Forum - 10-31-2013 [eluser]InsiteFX[/eluser] Code: /* This is in the HMVC documentation. |