Disable pre_controller hook on some controllers |
[eluser]taiar[/eluser]
Is there any way to disable a pre_controller hook in an arbitrary controller? Thank's!
[eluser]CroNiX[/eluser]
in your precontroller hook, you can probably check to see if the request contains whatever controller you are trying to avoid is, and just "return" so it doesn't do any further processing. Not sure, haven't needed hooks.
[eluser]taiar[/eluser]
Nice, I found a sollution: On my hook class: Code: class MyHookClass { Thanks..
[eluser]CroNiX[/eluser]
That's basically what I said, except instead of just returning you set a variable to false. Why not just return so it doesn't process further?
[eluser]taiar[/eluser]
Because the hook can call any method of the class! So it would execute it even I return the controller.
[eluser]taiar[/eluser]
[quote author="taiar" date="1335296390"]Because the hook can call any method of the class! So it would execute it even I return the controller.[/quote] http://ellislab.com/codeigniter/user-gui...hooks.html |
Welcome Guest, Not a member yet? Register Sign In |