Welcome Guest, Not a member yet? Register   Sign In
controller design question
#1

[eluser]digitaldivaradio[/eluser]
I am digging into CodeIgniter and learning a lot. But I have a design question about Controllers...

Right now I have a Controller function that validates if a user is authenticated/logged in by verifying certain session value. I have the function defined within one Controller. But now I am seeing that I will have more areas of the website and will want to call other Controllers in those areas.

Should this function, called at the construct of each Controller, be defined within each Controller? Seems redundant, so I am sure there's a better way... like a lib. Can I call a lib at the construct of each controller that has this function as a class instead?

Is that the proper architecture???
#2

[eluser]JoostV[/eluser]
Have a look here: http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY




Theme © iAndrew 2016 - Forum software by © MyBB