Fix script ns ("." based name) replacement to "/"

This commit is contained in:
Niko 2022-02-09 22:28:46 +01:00
parent 46f922721d
commit 2f406745a8
1 changed files with 1 additions and 1 deletions

View File

@ -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
}
}