Over-engineering for a simple system |
I really feel like I'm making this harder than it needs to be, but I can't see a simpler solution... hopefully someone can help me on this.
I have a navigation sidebar (Bootstrap 4), and I want to set the navigation items as active when going to them. Some items are in a secondary drop-down menu, and so I need to set the parent as active (menu-open) also. So first I need to get the URI segments, and then determine if that path is under the parent and set both parent and child as active. My problem with the method I'm using is that it uses a lot of PHP in the view, instead of separating the logic to the controller. But I don't see a simple method of defining both paths in a controller, and then relaying that to the view for each of the menu items to be active or not active. Admin Controller PHP Code: <?php Sidebar View PHP Code: <nav class="mt-2"> |
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
|