title: Menu nav bootstrap and codeigniter class active
body: <pre class="lang-css prettyprint-override"><code>&lt;?php 
  $first_part = $this-&gt;uri-&gt;segment(1);
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
       &lt;meta charset="utf-8"&gt;
       &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
       &lt;title&gt;e-Posiedzenie&lt;/title&gt;
      &lt;link rel="stylesheet" href="&lt;?php echo base_url("assets/css/bootstrap.css"); ?&gt;" /&gt;
      &lt;link rel="stylesheet" href="&lt;?php echo base_url("assets/css/style.css"); ?&gt;" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
       &lt;div class="row"&gt;
                &lt;div class=" col-sm-12 hidden-xs"&gt;
                     &lt;img class="img-responsive" src="&lt;?php echo base_url('assets/images/header.png'); ?&gt;"&gt;
               &lt;/div&gt;
              &lt;div class=" col-xs-12 visible-xs"&gt;
                     &lt;img class="img-responsive" src="&lt;?php echo base_url('assets/images/headerS.png'); ?&gt;"&gt;
               &lt;/div&gt;
        &lt;/div&gt; 
  &lt;/div&gt;
  &lt;hr/&gt;
  
  &lt;div class="container"&gt;
  
      &lt;nav class="navbar navbar-inverse"&gt;
        &lt;div class="container-fluid"&gt;
          &lt;div class="navbar-header"&gt;
            &lt;a class="navbar-brand" href="#"&gt;e-Posiedzenie&lt;/a&gt;
          &lt;/div&gt;
          &lt;ul class="nav navbar-nav"&gt;
             &lt;li class="&lt;?php if ($first_part=="Home") {echo "active"; } else  {echo "noactive";}?&gt;"&gt;&lt;a href="&lt;?php echo site_url('Home'); ?&gt;"&gt;Strona domowa&lt;/a&gt;&lt;/li&gt;
             &lt;li class="&lt;?php if ($first_part=="Sitting") {echo "active"; } else  {echo "noactive";}?&gt;"&gt;&lt;a href="&lt;?php echo site_url('Sitting/4'); ?&gt;"&gt;Nadchodzące posiedzenia&lt;/a&gt;&lt;/li&gt;
             &lt;li class="&lt;?php if ($first_part=="History") {echo "active"; } else  {echo "noactive";}?&gt;"&gt;&lt;a href="&lt;?php echo site_url('history'); ?&gt;"&gt;Historia z posiedzeń&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="&lt;?php echo site_url('files'); ?&gt;"&gt;Pliki do pobrania&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;ul class="nav navbar-nav navbar-right"&gt;
  
            &lt;?php if($this-&gt;session-&gt;userdata('isAdmin')): ?&gt;  
            &lt;li&gt;&lt;a href="&lt;?php echo site_url('admin'); ?&gt;"&gt;&lt;span class="glyphicon glyphicon-user"&gt;&lt;/span&gt; Panel Admina &lt;/a&gt;&lt;/li&gt;
            &lt;?php endif; ?&gt;  
            &lt;?php if($this-&gt;session-&gt;userdata('isLoggedIn')): ?&gt;  
                &lt;li&gt;&lt;a href="&lt;?php echo site_url('login/do_logout'); ?&gt;"&gt;&lt;span class="glyphicon glyphicon-log-in"&gt;&lt;/span&gt; Wyloguj się &lt;/a&gt;&lt;/li&gt; 
            &lt;?php endif; ?&gt;
            &lt;?php if(!$this-&gt;session-&gt;userdata('isLoggedIn')): ?&gt; 
                 &lt;li&gt;&lt;a href="&lt;?php echo site_url('login'); ?&gt;"&gt;&lt;span class="glyphicon glyphicon-log-in"&gt;&lt;/span&gt; Zaloguj się &lt;/a&gt;&lt;/li&gt; 
            &lt;?php endif; ?&gt;
  
          &lt;/ul&gt;
        &lt;/div&gt;
  &lt;/nav&gt; 
  
  &lt;/div&gt;
  </code></pre>
  
  
  
  <p>Hi. I have template, where I have header, footer and menu, which you can see above. In this code and thanks bootstrap we can show active page "". 
  Because it is template in my project I can't change just in html code in easy way as I did past. I mean, I found some way, but I don't know is it good.</p>
  
  <p>The main question is whether this is a good option to start with Codeigniter and MVC? I nothing better could invent. For me this is good, but I want to learn good practice. THANKS YOU !</p>