Welcome Guest, Not a member yet? Register   Sign In
Should session data be handled in the view?
#5

[eluser]cartalot[/eluser]
>Within my header view file I am checking to see if the user is logged in so I can make the navigation page dynamic. e.g. If they are logged in show the UserCP and Logout buttons otherwise show Login and Register buttons. However should I be checking this in the controller or model?

a great example of what a "controller" does and why. so yeah -- that kind of 'if this condition, show this page' logic goes in the controller.

when you need to find out if they are a member -- thats what the "model" is about. in that case the model would query a database or a list
and say return a member id, or return false if they aren't registered.


Messages In This Thread
Should session data be handled in the view? - by El Forum - 07-06-2012, 06:14 AM
Should session data be handled in the view? - by El Forum - 07-06-2012, 08:13 AM
Should session data be handled in the view? - by El Forum - 07-06-2012, 09:23 AM
Should session data be handled in the view? - by El Forum - 07-06-2012, 09:32 AM
Should session data be handled in the view? - by El Forum - 07-06-2012, 01:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB