I have a controller and including two views from one function as below
$this->load->view('includes/header',$data);
$this->load->view('view_destinations',$data);
The view file view_destinations.php including a php menu file as follows
<? $this->load->view('includes/top_menu'); ?>
My question is, how can I pass data that is fetched from the controller to this included top_menu.php ?
Thank you guys
Inside your controller, have
before your view includes.
When you call
the
view_destinationsfile is going to haveWhich you can at that point, pass into the nested view file.
And inside your top_menu file you should have
$otherDatacontaining ‘testing’.