Welcome Guest, Not a member yet? Register   Sign In
Query available to all funtions in Controller
#1

[eluser]weetstraw[/eluser]
In my footer view I have a foreach loop, because of this, each function that uses this footer requires me to create the array for the loop.
Code:
'recent'=>$this->Home_model->getRecent(),

Question is...How to I make "recent" available to all functions in the controller without having to add it to each time?
#2

[eluser]Michael Wales[/eluser]
You can create the array that is passed to your view file within the controller's constructor. This will make it available to each method within that class.




Theme © iAndrew 2016 - Forum software by © MyBB