Skip to content

Instantly share code, notes, and snippets.

View atmd83's full-sized avatar

Andrew Markham-Davies atmd83

View GitHub Profile
@atmd83
atmd83 / menu.php
Last active December 29, 2015 17:39 — forked from oxyberg/menu.php
Function to return a class if the navigation menu is for the current url/child off in laravel 4
<?php
function menu ($url) {
if (preg_match ('#' . URL::to ($url) . '#', URL::current ())) return 'class="active"';
}
/*
* Usage
<a href="{{ URL::to ('store') }}"{{ menu ('store/*') }}>
*/