Welcome Guest, Not a member yet? Register   Sign In
Dynamic content in a view file?
#1

[eluser]Unknown[/eluser]
I'm bulding a website with all of the pages using the same view file.A pass the unique and dynamic generated content from each controller to the view file. Right now, I've made a library which is used to create a very simple menu. Since the library will be used on 99% of all my pages, it's automatically loaded by autoload.php.
However, and this is where I get uncertain, where is the best place to use the print_menu()?
Should I request it each and every controller and pass it to the view, or is it possible to request the function from the view file?
#2

[eluser]Thorpe Obazee[/eluser]
You can create a library to for loading dynamic content on the view file so you don't need to call that method from every controller.
#3

[eluser]Unknown[/eluser]
Thanks for your advice Smile




Theme © iAndrew 2016 - Forum software by © MyBB