Skip to content

Instantly share code, notes, and snippets.

@snapey
Forked from DanielMarklund/gist:3415529
Created January 28, 2014 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snapey/8661535 to your computer and use it in GitHub Desktop.
Save snapey/8661535 to your computer and use it in GitHub Desktop.
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
<a href="{{ URL::to( 'gallery') }}">
Gallery
</a>
</li>
<!-- Show link to 'account' if authed -->
@if ( Auth::check() )
<li class="{{ URI::is( 'account') ? 'active' : '' }}">
<a href="{{ URL::to( 'account') }}">
Account
</a>
</li>
@endif
<!-- Login/Logout depending on auth state -->
<li class="{{ URI::is( 'account/login') ? 'active' : '' }}">
@if ( Auth::guest() )
{{ HTML::link('account/login', 'Login') }}
@else
{{ HTML::link('account/logout', 'Logout') }}
@endif
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment