<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.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community