Last active
September 2, 2015 11:51
-
-
Save duikb00t/7f6311b0bb3084204eb1 to your computer and use it in GitHub Desktop.
Language Switcher blade laravel - add active class to the current language so you can style it with CSS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="language_bar_chooser pull-right"> | |
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties) | |
<li> | |
@if ( $localeCode == LaravelLocalization::getCurrentLocale() ) | |
<a class="active"rel="alternate" hreflang="{{$localeCode}}" href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">{{{ $properties['native'] }}}</a> | |
@else | |
<a rel="alternate" hreflang="{{$localeCode}}" href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">{{{ $properties['native'] }}}</a> | |
@endif | |
</li> | |
@endforeach | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment