Closed m1r0 closed 8 years ago
@m1r0 Agreed.
For now, this should do what you want:
Active::pattern(
ltrim(route('pages.show', $page->slug, false), '/')
);
I released a minor update for the 2.x
version. Your can see the release note.
In your case, I suggest using this expression to set the active class when the current route is admin.product-types.categories.index
and the value of the product_types
parameter is 1
:
Active::routeParam('admin.product-types.categories.index', ['product_types' => 1])
I also rewritten the package and release it as a new major version, the 3.0.0
. You can see the new documentation with new API in the master branch.
@letrunghieu Thanks.
I think it would be a good idea to include the route parameters and not only the route name.
Lets say we need to set an active class for the route
admin/product-types/{product_types}/categories
.We can do something like (not a very good example but hopefully you get the point):
Active::route(['admin.product-types.categories.index' => [$product_type->id]])