Welcome Guest, Not a member yet? Register   Sign In
Start function
#1

[eluser]blaff[/eluser]
Everytime a page runs i want one function to run first. How do i do this?

It doesn't mather what page it is, it should run all the time.

Best regards,
Mikael
#2

[eluser]xwero[/eluser]
You could use a hook to do it.
#3

[eluser]blaff[/eluser]
Hi again,

Can I use that for an autoload library function?
#4

[eluser]xwero[/eluser]
I'm not that familiar with hooks. But i think if you use the post_controller_constructor hook you should be able to call autoloaded libraries using the get_instance function.
#5

[eluser]Wuushu[/eluser]
What would happen if in the auto-loaded library's constructor you call the library-function you wish to execute?
#6

[eluser]Mark van der Walle[/eluser]
What about autoloading a library and in the constructor call the function you need to run? It depends a bit on what the function is supposed to do.
#7

[eluser]blaff[/eluser]
Thanks everybody, I solved it!




Theme © iAndrew 2016 - Forum software by © MyBB