Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0
<li {{ Request::is('tags') ? 'class="active"' : '' }}>{{ HTML::linkRoute('tags.index', 'Tags') }}</li>

Something I used in an older project. Not the cleanest way but it gets the job done.

You could extract that to a helper function or a presenter to clean it up a bit.

Last updated 2 years ago.
0

pogachar said:

<li {{ Request::is('tags') ? 'class="active"' : '' }}>{{ HTML::linkRoute('tags.index', 'Tags') }}</li>

Something I used in an older project. Not the cleanest way but it gets the job done.

You could extract that to a helper function or a presenter to clean it up a bit.

Or even better, use Request::segment(1) == 'tags' which will support URIs with more than 1 segment.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

shiva shiva Joined 24 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.