Skip to content

Instantly share code, notes, and snippets.

@heyost
Last active December 18, 2015 03:14
Show Gist options
  • Save heyost/ce33d22cc6db5b5996ca to your computer and use it in GitHub Desktop.
Save heyost/ce33d22cc6db5b5996ca to your computer and use it in GitHub Desktop.
Simple polymer custom elements import using PHP
<?php
$list = ['custom_elements_folder1', 'custom_elements_folder2'];
$num = 0;
for($num; $num < count($list); $num++){
$dir = glob($list[$num] . '/*');
foreach ($dir as $file) {
if(is_file($file) && strpos($file, '.html')){
echo "<link rel=\"import\" href=\"" . $file . "\">\n";
} else{
echo $file[0];
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment