Over-engineering for a simple system |
Perhaps not the best way to tackle your problem, but here is how I "check" the current page for the navigation.
You could load the current controller or method with something service('router')->controllerName(); then pass that to the navigation view as your current controller. Then all you need is PHP Code: class="nav-item <?= $Controller == 'admin' ? 'active' : ''; ?>" Same can be done for ->methodName() if needed too. This might decrease some php code in your view. |
Messages In This Thread |
Over-engineering for a simple system - by BilltheCat - 04-19-2020, 03:12 PM
RE: Over-engineering for a simple system - by berendbotje91 - 04-20-2020, 01:24 AM
RE: Over-engineering for a simple system - by BilltheCat - 04-20-2020, 05:42 AM
RE: Over-engineering for a simple system - by InsiteFX - 04-20-2020, 04:04 AM
RE: Over-engineering for a simple system - by InsiteFX - 04-20-2020, 07:58 AM
|