Skip to content

Commit

Permalink
Update static file getter
Browse files Browse the repository at this point in the history
  • Loading branch information
carry0987 committed Jul 15, 2024
1 parent d151929 commit 585ac5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,14 @@ public function loadJSFile(string $file)
return $file.'?v='.$js_version_check['verhash'];
}

//Load static files
public function loadStaticFile(string $file)
{
$file = Utils::trimPath($this->options['static_dir'].Template::DIR_SEP.$file);

return $file;
}

//Throw error excetpion
private static function throwError(string $message, string $file_msg = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ private function parse_static_1(array $matches)
{
if ($this->options['static_dir'] === false) return $matches[1];

return $this->options['static_dir'].$matches[1];
return $this->stripvTags('<? echo TPL::getAsset()->loadStaticFile(\''.$matches[1].'\');?>');
}

private function parse_stripvtags_echo1(array $matches)
Expand Down

0 comments on commit 585ac5b

Please sign in to comment.