Created
January 1, 2013 11:53
-
-
Save ahmednuaman/4426911 to your computer and use it in GitHub Desktop.
A simple PHP asset helper
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 | |
function get_assets($ext, $template) | |
{ | |
$folders = array( | |
'assets/' . $ext . '/vendor', | |
'assets/' . $ext | |
); | |
foreach ($folders as $folder) | |
{ | |
$files = scandir(FCPATH . $folder); | |
foreach ($files as $file) | |
{ | |
if (strstr($file, $ext)) | |
{ | |
printf($template . "\n", site_url($folder . '/' . $file)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment