Closed lowerends closed 7 years ago
I support this. This is useful so we don't have to write all the routes there to tell the active class to be activated. For example I want to put an active class for user module but I have add, edit, view and other pages there as well so for every action I'll have to make a condition. This makes it ugly and messy.
Right now as an alternate I do this which solves the problem and I don't have to add condition for all my pages like add, edit, view. They all exist in a same controller so passing the name itself will get it going.
{{ active_class(current_controller() == controller('Dashboard'), 'active', '') }}
//my helper.php
function controller($name)
{
return 'App\\Http\\Controllers\\'.$name.'Controller';
}
I'm encountering a use case where I need a pattern to match except for a specific URL. For example, I want the pattern
'users*'
to match except for'users/all'
. If I'm not mistaken, this is not possible yet with this package, so I'm looking for feedback whether it would be useful to add this.Thanks!