Skip to content

Instantly share code, notes, and snippets.

@mikekoro
Last active December 23, 2015 01:09
Show Gist options
  • Save mikekoro/6558957 to your computer and use it in GitHub Desktop.
Save mikekoro/6558957 to your computer and use it in GitHub Desktop.
<?php
HTML::macro('clever_link', function($route, $text) {
if( Request::path() == $route ) {
$active = "class = 'active'";
}
else {
$active = '';
}
return '<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