Welcome Guest, Not a member yet? Register   Sign In
How to accomplish this
#1

[eluser]jfenety[/eluser]
How can I accomplish this problem without repeating a bunch of code. I have a view, header.php that is loaded from the controller $this->load->view(header.php) for each page that needs the header. Example, I have three controllers, one for main, one for about, and one for contact. The code has to be in each of these.

I want to have a Welcome, user at the top of the screen. I am using tank auth, in the controller I call isloggedin and then pass the username to the view from the controller. Is there a way I can do this without having to put this statement into every controller that needs the header.php?

Could I call the tank auth library from the view, and get the user name in the view? Or would this introduce problems, or ruin the MVC architecture?

Jfenety


Messages In This Thread
How to accomplish this - by El Forum - 04-16-2011, 10:59 AM
How to accomplish this - by El Forum - 04-16-2011, 11:36 AM
How to accomplish this - by El Forum - 04-16-2011, 11:56 AM
How to accomplish this - by El Forum - 04-16-2011, 12:04 PM
How to accomplish this - by El Forum - 04-16-2011, 12:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB