php - codeigniter : pass data to a view included in a view -


i have controller , including 2 views 1 function below

$this->load->view('includes/header',$data); $this->load->view('view_destinations',$data); 

the view file view_destinations.php including php menu file follows

<? $this->load->view('includes/top_menu'); ?> 

my question is, how can pass data fetched controller included top_menu.php ?

thank guys

inside controller, have

$data['nestedview']['otherdata'] = 'testing'; 

before view includes.

when call

$this->load->view('view_destinations',$data); 

the view_destinations file going have

$nestedview['otherdata']; 

which can @ point, pass nested view file.

<? $this->load->view('includes/top_menu', $nestedview); ?> 

and inside top_menu file should have $otherdata containing 'testing'.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -