Skip to content

Instantly share code, notes, and snippets.

@ahmednuaman
Created January 1, 2013 11:53
Show Gist options
  • Save ahmednuaman/4426911 to your computer and use it in GitHub Desktop.
Save ahmednuaman/4426911 to your computer and use it in GitHub Desktop.
A simple PHP asset helper
<?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