Welcome Guest, Not a member yet? Register   Sign In
RoR-like ApplicationController for CI... how?
#1

[eluser]oscaralexander[/eluser]
I'm very new to CI but have done some RoR development in the past. RoR provides developers with a basic ApplicationController which is initialized (once, I believe) at each request. So, say you call /blog/view/my-post, it first instantiates the ApplicationController and executes whatever code you put inside its constructor.

I used this controller to check whether the user is logged in and make user data available to the view, prior to executing the requested controller/action (i.e. /blog/view/my-post). This was convenient since I needed user data in 90% of the views, across different controllers.

What is the CI way of doing this? Sub-classing the Controller and autoloading it? Hooks?

Please help Smile


Messages In This Thread
RoR-like ApplicationController for CI... how? - by El Forum - 01-12-2009, 01:56 PM
RoR-like ApplicationController for CI... how? - by El Forum - 01-12-2009, 02:23 PM
RoR-like ApplicationController for CI... how? - by El Forum - 01-12-2009, 02:34 PM
RoR-like ApplicationController for CI... how? - by El Forum - 01-12-2009, 02:40 PM
RoR-like ApplicationController for CI... how? - by El Forum - 01-12-2009, 02:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB