Issue with hook and template library - 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: Issue with hook and template library (/showthread.php?tid=60207) |
Issue with hook and template library - El Forum - 02-05-2014 [eluser]xtremer360[/eluser] I am coming across a weird error message that I've never come across before. When I load my login page I get the following error. Code: A PHP Error was encountered I am using Phil Sturgeon's template library for my codeigniter application. It is currently autoloaded. I've included the hook that I am using for my system because if I keep it I get the error message. If I comment it out then I don't get the error message. To the best of my knowledge there is no error with its 7 lines of code or the sys_prescript.php file. application/config/hooks.php Code: $hook['pre_controller'] = array( application/controllers/sys_prescript.php Code: <?php application/controllers/login.php Code: <?php Issue with hook and template library - El Forum - 02-05-2014 [eluser]CroNiX[/eluser] Hooks are not controllers. Issue with hook and template library - El Forum - 02-05-2014 [eluser]xtremer360[/eluser] What am I missing here then? Issue with hook and template library - El Forum - 02-05-2014 [eluser]CroNiX[/eluser] Your hook extends CI_Controller. They are just stand alone classes, or functions. Just curious, didn't you have all of this working in your Admin_controller? Why change it? Issue with hook and template library - El Forum - 02-05-2014 [eluser]xtremer360[/eluser] Yes, but I wanted to go a different route. I've tried it both ways before and I prefer it this way but yeah of course the dreaded fix one error get another is presented. Code: A PHP Error was encountered Issue with hook and template library - El Forum - 02-05-2014 [eluser]CroNiX[/eluser] Ok, well your different route is going to take you longer to figure out, which adds to the cost of your project for something that was already done and working. You must have a very understanding employer/client. It's not as straight forward as the admin_controller. If you've tried both ways, then you shouldn't be having this issue and know that standalone classes/functions/helpers don't know anything about CI until you tell it via get_instance(), just like a custom library/helper/etc. |