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

#4
[eluser]John_Betong[/eluser]
Hi,

>>> When I build an app, I usually create a master view like this :
 
Try this instead
Code:
class Welcome extends Controller
{
  function Welcome()
  {
    parent::Controller();    
  }    
  function index()
  {
    $data = array();
    $data['title'] = 'My Great Title';

    $data[''content'] = $this->load->view('content_partial_view', $data, TRUE);
    $data['sidebar']  = $this->load->view('sidebar_partial_view', $data, TRUE);

    // See Xwero's better way of using array data below
    $output = $this->load->view('master', $data, TRUE);
    echo $output;

  }//endfunc

}//endclass
 
  


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.