vendredi 9 octobre 2015

Add "active" class in blade depending on current translated Laravel route

Using the package mcamara/laravel-localization in Laravel 5.1 I managed to localize my site and also to translate the routes. The problem is now the following: How can I add a custom class "active" via blade template depending on the current route?

I have tried so far using HTML::macro but it seems the package laravelcollective/html: "5.1.*" isn't fully compatible (especially macros) with L5.1.

Even if I would manage to use an macro I can not use the Request::is('about') because the routes are translated. I'm pretty sure here has to be an easy approach...

Example routes:
http://ift.tt/1GAOLB6
http://ift.tt/1G34UnX



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire