Welcome Guest, Not a member yet? Register   Sign In
Dynamic header menu ( MVC)
#1

[eluser]comex[/eluser]
Hello,

I currently have a view file that contains my menu(top) that gets loaded on every page. Up until now it has been sufficent with static links(and some minor PHP to check if the user is logged in e.t.c..)
What I want to do now is to add more checks(depending on which section the user is browsing and so on) and I was wondering how you guys would do the code layout? It gets quite ugly with a lot of PHP in a view file.
Any clever solutions to this "problem"?

Thank you
#2

[eluser]brianw1975[/eluser]
I'd write a helper library and call a build_menu function that returns the menu with the appropriate changes based on their location.




Theme © iAndrew 2016 - Forum software by © MyBB