Welcome Guest, Not a member yet? Register   Sign In
How is CI intended to be used?
#5

[eluser]Phil Sturgeon[/eluser]
Think about using a modular structure. A module can then be a mini-aplpication on its own, with its own models, controllers, views, etc. I have a module for blog, users (contains logic, etc) and it keeps things separated.

If you need to run a method from another controller then redirect to it. You should not need to directly run another method from a controller as jedd mentioned there is always another way to do it.

All of my Admin controllers for example have their own type of MY_Controller (its extended again and called Admin_Controller, but now im probably just being confusing). In the constructor of this type of MY_Controller I have a call to the user library, which checks a user is a logged in admin, and if not redirects to login.

Between models, libraries and redirects you entirely cut out the need to directly call a controller method.


Messages In This Thread
How is CI intended to be used? - by El Forum - 08-30-2009, 10:37 AM
How is CI intended to be used? - by El Forum - 08-30-2009, 11:54 AM
How is CI intended to be used? - by El Forum - 11-26-2009, 11:00 AM
How is CI intended to be used? - by El Forum - 11-26-2009, 12:37 PM
How is CI intended to be used? - by El Forum - 11-27-2009, 02:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB