Open Jasonzhangjs opened 4 years ago
try to take a look your backend code i think you have a error or your have 2 or more li active declarations. I use the route page for taking the item correct. like this in Symfony 4
<li {{ (app.request.get('_route')[:10]=='dashboard_' ) ? 'class="active"' : '' }}>
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">dashboard</i>
<span>Dashboards</span>
</a>
<ul class="ml-menu">
<li {{ (app.request.get('_route')=='dashboard_sales' ) ? 'class="active"' : '' }}>
<a href="{{ path('dashboard_sales') }}">Ventas</a>
</li>
<li {{ (app.request.get('_route')=='dashboard_purchases' ) ? 'class="active"' : '' }}>
<a href="{{ path('dashboard_purchases') }}">Compras</a>
</li>
</ul>
</li>
When the page reloads, the label(li class="active") has been cleared