如何使我的侧边栏在当前页面中处于活动状态,我陷入困境并需要帮助,这是我的sidebar.php代码:
<ul id="dashboard" class="sidebar navbar-nav">
<li class="nav-item <?php echo $this->uri->segment(1) == '' ? 'active': '' ?>">
<a class="nav-link" href="<?php echo site_url('admin') ?>">
<i class=""></i>
<span>DASHBOARD</span>
</a>
</li>
<li class="nav-item dropdown <?php echo $this->uri->segment(2) == 'list'? 'active': '' ?>">
<a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
<i class=""></i>
<span>INCIDENT</span>
</a>
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
<a class="dropdown-item" href="<?php echo site_url('admin/problem/add') ?>">Problem IT Cabang</a>
<a class="dropdown-item" href="<?php echo site_url('admin/atm/add') ?>">Problem Jarkom ATM</a>
<a class="dropdown-item" href="<?php echo site_url('admin/Request/add') ?>">Request</a>
</div>
</li>
</ul>