04-04-2009, 02:14 PM
[eluser]nubianxp[/eluser]
How do you use a model's output on one controller, but have it display on several views?
For example, I have a model that queries a welcome message and I want to display the data on the footer area (footer.php) so it shows up on every page, what should be the content of my controller? footer.php is called by views/index.php using <?=$this->load->view('footer')?>
Pretty trivial, but I'm just starting out with PHP, I know the first part of the controller file, but I don't know how to pass the $data to the footer.php, problem is, I get a variable undefined error.
How do you use a model's output on one controller, but have it display on several views?
For example, I have a model that queries a welcome message and I want to display the data on the footer area (footer.php) so it shows up on every page, what should be the content of my controller? footer.php is called by views/index.php using <?=$this->load->view('footer')?>
Pretty trivial, but I'm just starting out with PHP, I know the first part of the controller file, but I don't know how to pass the $data to the footer.php, problem is, I get a variable undefined error.