title: CodeIgniter create a layout/template library
body: <p>Before I begin I have to say that I have recently started learning CodeIgniter, so I'm sorry if I repeat this subject once again.</p>
  
  <p>In procedural php I would do something like this</p>
  
  <pre><code>// the header.php
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
        &lt;meta name="description" content="blah blah"&gt;
        &lt;title&gt;My Site&lt;/title&gt;
        &lt;link href="css/main.css" rel="stylesheet" media="screen"&gt;
  &lt;php? if($current_page == 'about.php'): ?&gt;
        &lt;link href="css/secondary.css" rel="stylesheet" media="screen"&gt; // or some embed styles (&lt;stlye&gt; ... &lt;/style&gt;)
     &lt;?php endif; ?&gt; 
  
  
        &lt;script src="http://code.jquery.com/jquery.js"&gt;&lt;/script&gt;
        &lt;script src="js/main_script.js"&gt;&lt;/script&gt;
  
        &lt;php? if($current_page == 'contact.php'): ?&gt;
        &lt;script src="js/validation.js"&gt;&lt;/script&gt;
        &lt;?php endif; ?&gt;
  &lt;/head&gt;
  &lt;body&gt;
       // end of header.php
  
       include('template/header.php');
  
       &lt;h1&gt;Heading1&lt;/h1&gt;    
       &lt;p&gt;Lorem Ipsum...&lt;/p&gt;
  
       include('template/footer.php');
  
      //footer.php
      //maybe some js and here
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So I would like to do something similar and in CI. All pages/views will have the same main styles or scripts, but in some cases, some specific pages (like contact.php) may include, and <strong>only</strong> in these pages, some specific styles or scripts (like the validation.js).</p>
  
  <p>I have found this <a href="http://www.youtube.com/watch?v=l3tA5AVB454" rel="nofollow">video</a> that shows how to create a template/layout library using CI, but I'm not quite sure how I can apply this functionality to work properly. </p>