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

[eluser]Unknown[/eluser]
Hello,

This weekend I will hopefully finish porting a CFM application to Code Igniter.

I am still reviewing the documentation but was hoping to get some answers to a few things to speed me along.

Here is my first question:

In CFML there feature called onRequestStart where any code in the function gets called on every single request.

How would I do this in CI?

I found this: http://ellislab.com/codeigniter/user-gui...oader.html

but I am assuming though that things autoloaded in that folder would only be fired when the application was initialized.

Thanks!

Randy

#2

[eluser]davidMC1982[/eluser]
You have two options:

1) Extend the Controller class and put your code in the constructor. All your controllers should then extend this new class and call the super constructor in its own constructor.

2) Probably better would be to use hooks.

http://ellislab.com/codeigniter/user-gui...hooks.html




Theme © iAndrew 2016 - Forum software by © MyBB