title: CodeIgniter Template Parser Extends MY_Parser To Auto Load/Parse Header Footer
body: <p>My template parser looks like this (p/s the .'/'. is for readability):</p>
  
  <pre><code>$this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'header', $data);
  $this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'register', $data);
  $this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'footer', $data);
  </code></pre>
  
  <p>I don't want to declare <code>$this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'header', $data);</code> and <code>$this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'footer', $data);</code> every time in my controller's functions.</p>
  
  <p>How can I extend the <code>MY_Parser.php</code> so that I could use it like this instead:</p>
  
  <p><code>$this-&gt;parser-&gt;parse($this-&gt;settings['theme'].'/'.'register', $data);</code> will include the <code>register.php</code> between my <code>header.php</code> and <code>footer.php</code> automatically.</p>
  
  <p>The benefit of doing this is to save 2 lines and if I have 20 functions, I can save 40 lines.</p>