change header values based on variable codeigniter -


i have following in header:

<div id="wrapper" class="homepage itemlist com_k2 category">   <div id="rt-header">     <div class="rt-container">       <div class="rt-grid-3 rt-alpha">         <div class="rt-block"><a href="#" id="rt-logo"></a></div>       </div>       <div class="rt-grid-9 rt-omega">         <div class="rt-fusionmenu">           <div class="nopill">             <div class="rt-menubar">               <ul class="menutop level1 ">                 <li class="parent  root f-main-parent firstitem f-mainparent-item"> <a class="daddy item bullet" href="www.domain.com"> <span> الرئيسية </span> </a> </li>                  <li class="active root"> <a class="orphan item bullet" href="load_kitchen_list"> <span> المطبخ </span> </a> </li>                 <li class="root"> <a class="orphan item bullet" href=""> <span style="font-size:medium;"> الملف الشخصي </span> </a> </li>                 <li class="root"> <a class="orphan item bullet" href="main/contactus"> <span> للإتصال بنا</span> </a> </li>               </ul>             </div>           </div>         </div>       </div>       <div class="clear"></div>     </div>   </div> 

now if investigate

  • elements, find there active flag in 1 of them. makes sure seen page highlighted in navigation bar. want know how can change based on view loaded? how load views:

    $this->load->view('layout/header'); $this->load->view('home'); $this->load->view('layout/footer'); 

    so in case main navigation tab should active.

    regards,

  • i completed similar recently. not best way, works me.

    in controller add before views

    $data['contact'] = 'active'; 

    then pass $data variable controller view

    $this->load->view('header', $data); 

    and in view add list item

    <li class="contact <?php if(isset($contact)) {echo $contact; }"> 

    Comments

    Popular posts from this blog

    Why does Ruby on Rails generate add a blank line to the end of a file? -

    keyboard - Smiles and long press feature in Android -

    node.js - Bad Request - node js ajax post -