A Few Hook Questions |
[eluser]xtremer360[/eluser]
I'm trying to figure out a few things like: 1. If this is the properly written hook file. 2. I keep getting errors like these: Code: Severity: Notice Code: <?php
[eluser]xtremer360[/eluser]
To run during the whole CMS project. That way if the user isn't logged in then they can't access any of the pages.
[eluser]CroNiX[/eluser]
No, which hook is this being called from...pre_system, pre_controller, etc.
[eluser]xtremer360[/eluser]
Code: $hook['pre_controller'] = array(
[eluser]CroNiX[/eluser]
Just curious if it was the pre_system hook, as the Router isn't even loaded at that point. But it should be for pre_controller...so I'm not sure why that wouldn't work. For troubleshooting, you could: Code: var_dump($this->CI->router);
[eluser]CroNiX[/eluser]
It doesn't look like the global CI object is available to some hooks. If you look at /system/core/CodeIgniter.php, you will see exactly the order that CI loads things, and when it fires certain hooks. Not everything is fully loaded depending on what hook you are trying to access. Again, the hooks documentation is very lacking, which is probably why hooks are rarely utilized. Has your friend who suggested you start down this path actually tried to do this? You might ask him/her how they did it.
[eluser]CroNiX[/eluser]
http://stackoverflow.com/questions/21965...ng-helpers
[eluser]xtremer360[/eluser]
Wow that worked! Thank you. I've been doing days of research and have never seen that post. |
Welcome Guest, Not a member yet? Register Sign In |