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

[eluser]boltsabre[/eluser]
You're not "limited", it's just how coding works (well, until quantum computing comes along).
At some point, somewhere, you have to make a "logged in/out" check and act upon the result of that check AKA if/else


I suppose what you could do is set a variable called "$logged, and when logged in it = "in", when logged out it = "out"

Then in your views you could put in all your "shared" content, and where you want to include something you could use

$this->load->view($logged.'/some_sub_view1');

And organise your view folders like:

views/in/some_sub_view1
views/out/some_sub_view1

And then when you want some logged in stuff, in "views/in/some_sub_view1" you add it and in "views/out/some_sub_view1" you just keep the file empty.
And then when you have content for just logged out users you use the same process in reverse, make a new view, leaving the logged in file empty.
But... then you have to make a bunch of empty views, could be more confusing than it's worth. Depending on your situation.


Anyway, good luck with it!


Messages In This Thread
Login system - handling same view that is different for user and guest - by El Forum - 01-11-2013, 08:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB