Welcome Guest, Not a member yet? Register   Sign In
Hooks and redirects
#1

If you set up a hook to execute post_controller or even post_system, the hook won't execute if you redirect out of the controller. That makes sense, since redirect ends the script's execution. One possible solution is to set up a view that contains the redirect. That way, the controller will finish executing, the hook will execute, and the redirection still takes place.

Any comments or better ideas?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#2

What do you want to do in the hooks?
Reply
#3

Well, it's actually not my application. Someone posted in the regional forum, but they only write Spanish, so I offered to translate the issue here and ask. He said that what he's trying to do is to save some sort of log at the end of the controller's execution.

Controllers always exit through a view or a redirect? Does that sound right?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB