diff --git a/src/VIEW.php b/src/VIEW.php index 2041a05..589957d 100644 --- a/src/VIEW.php +++ b/src/VIEW.php @@ -108,6 +108,15 @@ public function render($data = null, $legacy = false) { }); $twig->addFunction($returnFunction); + /** + * asset() function + */ + $returnFunction = new \Twig\TwigFunction('asset', function ($value) { + include_once(UTILITY_PATH."/Helpers/asset.php"); + return \asset($value); + }); + $twig->addFunction($returnFunction); + if(empty($data)){ $data = array(); }