')

Laravel 4: Active Class For Navigational Menu

Posted by on in Laravel

This example utilizes Laravel’s HTML::macro() method. Open up your current application’s routes.php file and paste this snippet:


Your blade template for navigational menu should be something like this:

<ul>
    <li>{{ HTML::clever_link("/", 'Home' ) }}</li>
    <li>{{ HTML::clever_link("blog", 'Blog' ) }}</li>
</ul>