Created
December 5, 2018 08:20
-
-
Save savepong/413db7780a1705ec9e81d5ee35e52f47 to your computer and use it in GitHub Desktop.
ฟังก์ชั่นเช็คชื่อ Route ที่กำลังเปิดอยู่
This file contains 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('routeIsActive')) { | |
function routeIsActive($routes, $print = 'active'){ | |
if (is_array($routes)) { | |
foreach ($routes as $route) { | |
if(Route::is($route)){ | |
return $print; | |
} | |
} | |
return ''; | |
} | |
return Route::is($routes) ? $print : ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment