Skip to content

Commit

Permalink
added asset function
Browse files Browse the repository at this point in the history
  • Loading branch information
Desmond committed Dec 9, 2019
1 parent 562716b commit 3b13a00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/VIEW.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 3b13a00

Please sign in to comment.