Welcome Guest, Not a member yet? Register   Sign In
Navagation view
#1

[eluser]Moon 111[/eluser]
I have a view that I call in all my views that has the Naviagation Bar. I know need the Navigation Bar to be dynamic. How am I supposed to do this? For example, if a user is logged in they need a "logout" link, however, when they are logged out, they need a "login" link.

All help would be greatly appreciated,

- Moshe
#2

[eluser]Moon 111[/eluser]
Maybe I'll create and autoload a helper that can be used for that stuff? That way it can be used in the view too.
#3

[eluser]Aken[/eluser]
You can add PHP code to your view that checks to see if the user is logged in, and displays the appropriate information.
#4

[eluser]Moon 111[/eluser]
Can I load a Controller from a view?
#5

[eluser]Colin Williams[/eluser]
I would write a Menu library (or Model) that handles it. Controllers and Libraries, and maybe even Models, would be responsible for adding items to the menus that the Menu library controls. No need to call a Controller from the View in this case.




Theme © iAndrew 2016 - Forum software by © MyBB