title: CodeIgniter: How to match current_url against views url (to construct a nav)
body: <p>In order to apply the active class to the current item in the navigation menu. I need to check if its link is equal to the URL</p>
  
  <p>I am trying like this:</p>
  
  <pre><code>&lt;ul class="nav"&gt;
      &lt;li class="&lt;?php if(uri_string(current_url()) == base_url() || uri_string(current_url()) == '') echo 'active'; ?&gt;"&gt;
           &lt;a href="&lt;?php echo base_url() ?&gt;"&gt;Home&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="&lt;?php if(uri_string(current_url()) == base_url('news/create/')) echo 'active'; ?&gt;"&gt;
          &lt;a href="&lt;?php echo base_url('news/create/') ?&gt;"&gt;+ New&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Wich seems to work fine with the home</p>
  
  <p>But in news/create won't ever be equal....</p>
  
  <p>It compares <strong>news/create</strong> (<code>uri_string(current_url()</code>) with <strong>/news/create</strong> (<code>base_url('news/create')</code>)</p>
  
  <p>So.. what's <strong>the way</strong> to go with this issue?</p>