title: Codeigniter Link to Stylesheet
body: <p>I am trying to learn Codeigniter. I have built a simple MVC following the tutorials on the CI site. This is my controller...</p>
  
  <pre><code>&lt;?php
  
  class Pages extends CI_Controller {
  
      public function view($page = 'home'){
  
          if(!file_exists(APPPATH.'/views/pages/'.$page.'.php')){
              show_404();
          }
  
          $data['title'] = ucfirst($page);
  
          $this-&gt;load-&gt;view('templates/header', $data);
          $this-&gt;load-&gt;view('pages/'.$page, $data);
          $this-&gt;load-&gt;view('templates/footer', $data);
      }
  }
  </code></pre>
  
  <p>Here is the header template...</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;?php echo $title ?&gt; - WurkWithUs&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://localhost/ci/CodeIgniter_2.1.2/css/bootstrap.css" type="text/css" media="screen"/&gt;
      &lt;link rel="stylesheet" href="http://localhost/ci/CodeIgniter_2.1.2/css/custom.css" type="text/css" media="screen"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Wurk With Us&lt;/h1&gt;
  </code></pre>
  
  <p>The style sheets work when I use an absolute path like the one above. However if I try to use something like... </p>
  
  <pre><code>&lt;link rel="stylesheet" href="&lt;?= base_url()?&gt;css/bootstrap.css" type="text/css" media="screen"/&gt;
  </code></pre>
  
  <p>I get a blank page. When I "view page source" my style line looks like...</p>
  
  <pre><code>    &lt;link rel="stylesheet" href="
  </code></pre>
  
  <p>I have tried to follow the suggestions <a href="https://stackoverflow.com/questions/2745153/codeigniter-php-stylesheet-link-how">here</a> and I get the same results i.e. document stops being parsed at the "href=" line. </p>
  
  <p>What am I doing wrong? Is there a better way to load my stylesheets?</p>