Welcome Guest, Not a member yet? Register   Sign In
Login system - handling same view that is different for user and guest
#1

[eluser]mailarz[/eluser]
Hello,

So straight to the point, i'll be using example:
Let's say i want to build an e-book app, that on main page (when user is not logged in)shows list of popular e-books, and some other default information. When user logs in, some of the content change, but some remains the same (for example user mini panel shows up, list result are based on user preferences etc.).

How should i handle a login system like this?

I know that best practice is to extend my CI_Controller to check for login status, but that's the part i understand and agree with. But later on, should my every controller (for examples purpose let's assume that every view has it's logged_in/logged_out state) have if statement, that if TRUE it calls view sending some user parameters, but if not, it calls same view without those paremeters. Is that the right approach? Is there away to avoid that repeating same if login statement in every controller to determine how the view should be called?

Thanks in advance,
Best regards


Messages In This Thread
Login system - handling same view that is different for user and guest - by El Forum - 01-10-2013, 04:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB