Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christianesperar/8196384 to your computer and use it in GitHub Desktop.
Save christianesperar/8196384 to your computer and use it in GitHub Desktop.
Add HTML::decode in case developer want to have HTML tags on text. Ex: Bootstrap Icon
<?php
HTML::macro('clever_link', function($route, $text) {
if( Request::path() == $route ) {
$active = "class = 'active'";
}
else {
$active = '';
}
return HTML::decode('<li ' . $active . '>' . link_to($route, $text) . '</li>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment