php - menu tab not becoming active in codeigniter -


here menu tabs not becoming , don't know why seems this.here control please have

public function vehicle($id=null) {     if (!empty($id)) {         $data['active'] = 2;         $this->vehicle_model->_table_name = "tbl_vehicles"; //table name         $this->vehicle_model->_order_by = "id";         $data['vehicle_info'] = $this->vehicle_model->get_by(array('id' => $id), true);      } else {         $data['active'] = 1;     }     $data['all_vehicle_info'] = $this->vehicle_model->view_vehicle(null,null);     $this->load->view('admin/vehicle/add_vehicle',$data);  } 

here view

<ul class="tabs rs-tab">     <li class="<?php echo ($active == 1) ? "active" : ""; ?> tab col s3 "><a href="#manage" >all vehicles</a></li>     <li class="<?php echo ($active == 2) ? "active" : ""; ?> tab col s3"><a href="#create" >new vehicles</a></li>   </ul> <div class="<?php echo ($active == 1) ? "active" : ""; ?>" id="manage" > </div>    <div class="<?php echo ($active == 2) ? "active" : ""; ?>" id="create"> </div> 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -