Reputation: 3506
I'm currently using laravel 4.1 and im relatively new to laravel. By now laravel is great and helps me very much.
Creating a navigation menu seems by now a bit tricky. I dont' know where to put the logic for the menu so i can use it in a template file. Sure, i found an example (https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/master/app/views/admin/layouts/default.blade.php) but, it seems for me ugly to reference multiple times to the url.
By now i'm using some logic like this: http://paste.laravel.com/1huc . This will do the job for a sidenavigation and looks "ok" to me, but i'm wondering if there is a better solution. Any advice?
Upvotes: 1
Views: 2385
Reputation:
In your view you can use @if (URI::is('name_of_route')) class="active" @endif
to check if a given route is the current route.
Upvotes: 2