mirror of
https://github.com/flextype/flextype.git
synced 2025-08-13 08:34:19 +02:00
Flextype Core: Assets Twig Extension - updates
This commit is contained in:
@@ -282,6 +282,10 @@ $flextype['view'] = function ($container) {
|
||||
// Add I18n Twig Extension
|
||||
$view->addExtension(new I18nTwigExtension());
|
||||
|
||||
// Add Assets Twig Extension
|
||||
$view->addExtension(new AssetsTwigExtension());
|
||||
|
||||
// Return view
|
||||
return $view;
|
||||
};
|
||||
|
||||
|
@@ -24,13 +24,14 @@ class AssetsTwigExtension extends \Twig_Extension
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFunction('assets_add', array($this, 'add')),
|
||||
new \Twig_SimpleFunction('assets_get', array($this, 'get')),
|
||||
];
|
||||
}
|
||||
|
||||
public function add(string $asset_type, string $asset, string $namespace, int $priority = 1) : void
|
||||
{
|
||||
return Assets::add($asset_type, $asset, $namespace, $priority);
|
||||
Assets::add($asset_type, $asset, $namespace, $priority);
|
||||
}
|
||||
|
||||
public function get(string $asset_type, string $namespace) : array
|
||||
|
Reference in New Issue
Block a user