Welcome Guest, Not a member yet? Register   Sign In
Controller, view question...
#6

[eluser]mrh[/eluser]
[quote author="Aken" date="1343695465"]I never mix the log in/out features with actually displaying content. For example, my admin controller would look something like this:

controller: admin.php

index() :: Check if logged in. If YES, show the page. If NO, redirect to login().

anothermethod() :: Another admin page. Do the same as index().

login() :: Check if logged in. If YES, then redirect to index() (we don't need them to log in twice). If NO, then show login form. Login form sends data back to this same method, not another. It processes supplied POST data and checks for a valid login. If YES, redirect to index(). If NO, show an error and the form again.[/quote]

Ok getting into symantecs... I see your point... But I could argue that the index() method of admin would then be responsible for loading two different views depending upon login state... But ya... I think that makes more sense.

Ok time to re-organize! Thanks again!


Messages In This Thread
Controller, view question... - by El Forum - 07-30-2012, 04:32 PM
Controller, view question... - by El Forum - 07-30-2012, 05:44 PM
Controller, view question... - by El Forum - 07-30-2012, 06:01 PM
Controller, view question... - by El Forum - 07-30-2012, 07:01 PM
Controller, view question... - by El Forum - 07-30-2012, 07:05 PM
Controller, view question... - by El Forum - 07-30-2012, 08:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB