• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sharing data between view partials

#5
[eluser]xwero[/eluser]
If you use load->vars the title will be 'global'
Code:
$this->load->vars(array('title'=>'My Great Title'));
$data = array(
      'content'=>$this->load->view('content_partial_view', '', TRUE),
      'sidebar'=>$this->load->view('sidebar_partial_view', '', TRUE)
    );
$this->load->view('master', $data);
But you have to be careful not to overwrite variables when adding partial related data.


Messages In This Thread
Sharing data between view partials - by El Forum - 10-15-2008, 09:53 AM
Sharing data between view partials - by El Forum - 10-15-2008, 10:31 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:05 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:11 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:19 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:23 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:33 AM
Sharing data between view partials - by El Forum - 10-16-2008, 02:54 AM
Sharing data between view partials - by El Forum - 10-16-2008, 03:12 AM
Sharing data between view partials - by El Forum - 10-16-2008, 03:43 AM
Sharing data between view partials - by El Forum - 10-16-2008, 03:47 AM
Sharing data between view partials - by El Forum - 10-16-2008, 04:27 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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