• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pass data to view from controller

#1
[eluser]PHPraja[/eluser]
i have the below code in my constructor of a class in a controller
Code:
$data['mystuffPlaces']=$this->place_model->get_places_mystuff();

and in another function of the same class i have
Code:
$layout['page_title'] = $this->lang->line('My_places');
$layout['body']=$this->load->view('place/user_all_places',$data, True);
$this->load->view('Layout', $layout);

To my surprise i found $data['mystuffPlaces'] is not passed to the layout view.
if i remove it in the constructor and place it in the same function it works!!

or if i replace $data with $this->data, even then though it is in constructor it works!! can any one plz explain me the difference..

Thanks in advance.


Messages In This Thread
pass data to view from controller - by El Forum - 05-15-2008, 05:10 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:22 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:48 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:50 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.