Welcome Guest, Not a member yet? Register   Sign In
How to create Hooks , Please help me?
#1

[eluser]phpfresher[/eluser]
I need to create a hook when the user login i.e. I have a controller user with method login. When the method login gets executed i need to create a hook.

Please write me the sample.

I would be thankful to you

Thanks in advance

Thank you
#2

[eluser]astroanu[/eluser]
hooks can be executed at end of each controller execution and etc.. i dont you can execute a hook on each login. why not make a function in a library class and call it on each login?
#3

[eluser]astroanu[/eluser]
also refer to the doc read the Hook Points section http://ellislab.com/codeigniter/user-gui...hooks.html
#4

[eluser]phpfresher[/eluser]
I have a library and hook function , and i want to execute the hook during the some particular function is executed not on post_controller_construct or pre_controller_construct.
#5

[eluser]astroanu[/eluser]
i dont think you can trigger a hook when a function is executed.

its better to add the syntax you want to execute in to a function and call it through the main function.

#6

[eluser]CroNiX[/eluser]
Hooks are built in and are only (automatically) executed at certain defined points in CI's code execution, as listed in the docs that astroanu posted. You're limited to those choices of defined hooks listed at the bottom.

If you are looking for an alternative solution to whatever you are trying to do, be more specific with what you are trying to do while leaving hooks out of it.




Theme © iAndrew 2016 - Forum software by © MyBB