This commit is contained in:
2025-05-07 11:42:33 -07:00
parent 8989d48386
commit cfd241ee0b
6 changed files with 21 additions and 1 deletions

View File

@@ -92,6 +92,13 @@ class RadThemeEngine
};
}
public static function assetContents()
{
return function ($template, $context, $args, $source) {
return site()->getAssetContents($args);
};
}
private static function getFromBuffer($func)
{
ob_start();

View File

@@ -601,6 +601,7 @@ class Site
"flex" => \ofc\RadThemeEngine::processFlex(),
"nl2br" => \ofc\RadThemeEngine::nl2br(),
"assetURL" => \ofc\RadThemeEngine::assetURL(),
"assetContents" => \ofc\RadThemeEngine::assetContents(),
];
foreach ($helpers as $name => $callback) {
$this->hb->addHelper($name, $callback);