Let's say my base controller, Controller_website, on which every normal controller extends, generates some data which I need in the most controllers. What is the best way to get those variables to every controller?
In CodeIgniter I use:
$this->load->vars($data);
And I was able to use the in the MY_Controller generated variables in every controller. I know about $this->template->content->set() but I need the variables in the controller, not in the view.
Create a Controller_Website controller that extends \Controller_Template...
All other controllers will extend Controller_Website...
add a public variable to Controller_Website and have it automatically set in the before() method...
Should work for you.
Ya, basically what nerdsrescueme said. Create a protected (possibly public) variable on one of the classes (NOT both). Then just set/get that variable.
Dan