Created
May 8, 2019 21:05
-
-
Save ahmedsayedabdelsalam/eb626b138b63ab7ab51fe64bef312ab2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| if (!function_exists('classActivePath')) { | |
| function classActivePath($segment, $value) | |
| { | |
| if(!is_array($value)) { | |
| return Request::segment($segment) == $value ? ' menu-open' : ''; | |
| } | |
| foreach ($value as $v) { | |
| if(Request::segment($segment) == $v) return ' menu-open'; | |
| } | |
| return ''; | |
| } | |
| } | |
| if (!function_exists('classActiveSegment')) { | |
| function classActiveSegment($segment, $value) | |
| { | |
| if(!is_array($value)) { | |
| return Request::segment($segment) == $value ? 'active' : ''; | |
| } | |
| foreach ($value as $v) { | |
| if(Request::segment($segment) == $v) return 'active'; | |
| } | |
| return ''; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment