title: What is the best practice for displaying multiple views in Codeigniter?
body: <p>I'm trying to determine the best practice for calling multiple views from the same method in a controller. </p>
  
  <p>Is it preferable in the controller to make one view call, then have that view call all the views it needs, or call all the views you need in sequence in the controller?</p>
  
  <p>Example: </p>
  
  <pre><code>function index(){
     //set all data variables
     //then send them to the view
     $this-&gt;load-&gt;view($index_view, $data);
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>function index(){
    //set variables
    //then call each view
    $this-&gt;load-&gt;view($header_view, $header_data);
    $this-&gt;load-&gt;view($body_view, $body_data);
    $this-&gt;load-&gt;view($footer_view, $footer_data);
  </code></pre>
  
  <p>The Codeigniter guide shows both ways, but does not seem to advise to the best practice...is there one?</p>