protected function dir($file = '') { $dir = Templates_HTML_Assets_Join::option('dir'); $ext = pathinfo($file, PATHINFO_EXTENSION); $paths = Templates_HTML::option('paths'); if (!empty($ext) && isset($paths[$ext])) { $dir = '/' . trim($paths[$ext] . '/' . trim($dir, PATH_SEPARATOR), '/'); } if (!is_dir('.' . $dir)) { IO_FS::mkdir('.' . $dir, IO_FS::option('dir_mod'), true); } return "{$dir}/{$file}"; }