title: Dynamic Titles in my codeigniter header.php
body: <p>I have a header.php I'm loading in my controllers for every page.  However I want to have dynamic titles for each page.  My idea was to pass a $title variable into the view as I'm loading it:</p>
  
  <pre><code>//Home Controller
  function index()
  {
  
      $data['title'] = "Dynamic Title";
  
      $this-&gt;load-&gt;view('header', $data);
      $this-&gt;load-&gt;view('layouts/home');
      $this-&gt;load-&gt;view('footer');
  
  }
  </code></pre>
  
  <p>and then check for the $title variable in my header.php</p>
  
  <pre><code>&lt;title&gt;
      &lt;?php if ($title)
          { 
              echo $title; 
          }
      else
          { 
              echo 'Default Title'; 
          }
      endif; ?&gt;       
  &lt;/title&gt;
  </code></pre>
  
  <p>However this doesn't work and I get a blank page.  I think it is my syntax for the header.php but I can't figure out why.</p>