Created
February 10, 2016 14:58
-
-
Save robi09/b246622ea2c30ec943e5 to your computer and use it in GitHub Desktop.
Get an array with all template parts from one folder
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
if(!function_exists('revive_home_sections')) { | |
function revive_home_sections() { | |
$array = array(); | |
$dir = R_PATH . "/parts/home/order/*"; | |
foreach(glob($dir) as $file) { | |
if(!is_dir($file)) { | |
$array[substr(basename($file), 0, strpos(basename($file), "."))] = ucfirst(str_replace('_', ' ', substr(substr(basename($file), 0, strpos(basename($file), ".")), 2))); | |
} | |
} | |
return $array; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment