Fix script ns ("." based name) replacement to "/"
This commit is contained in:
parent
46f922721d
commit
2f406745a8
|
@ -17,13 +17,13 @@ function tpl($ns, $args=[]) {
|
|||
|
||||
function tpl_script($script) {
|
||||
$suffix = '';
|
||||
$script = str_replace('.', '/', $script);
|
||||
if (getenv('env') === DEV)
|
||||
$suffix = '?_='.microtime();
|
||||
echo APP_DIR.'/js/'.$script.'.js'.$suffix;
|
||||
}
|
||||
function tpl_scripts($scripts) {
|
||||
foreach ($scripts as $script) {
|
||||
$script = str_replace('.', '/', $script);
|
||||
?><script type="application/javascript" src="<?php tpl_script($script) ?>"></script><?php
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue