Example #1
0
 public static function tag_for($path)
 {
     $type = \IO\File::ext($path);
     switch ($type) {
         case 'css':
             return \Labourer\Web\Html::link('stylesheet', static::url_for($path, 'styles_dir'), array('type' => 'text/css'));
         case 'js':
             return \Labourer\Web\Html::script(static::url_for($path, 'scripts_dir'));
         case 'jpeg':
         case 'jpg':
         case 'png':
         case 'gif':
             return \Labourer\Web\Html::img(static::url_for($path, 'images_dir'), $path);
         default:
             throw new \Exception("Unsupported tag for '{$type}'");
     }
 }