1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 16:14:16 +02:00

Flextype Core: Assets Twig Extension - added

This commit is contained in:
Awilum
2019-03-04 13:53:50 +03:00
parent 671e0e6797
commit f806505f9a

View File

@@ -0,0 +1,35 @@
<?php
/**
* @package Flextype
*
* @author Sergey Romanenko <hello@romanenko.digital>
* @link http://romanenko.digital
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Flextype\Component\Assets\Assets;
class AssetsTwigExtension extends \Twig_Extension
{
/**
* Callback for twig.
*
* @return array
*/
public function getFunctions()
{
return [
new \Twig_SimpleFunction('assets_get', array($this, 'get')),
];
}
public function get(string $asset_type, string $namespace) : array
{
return Assets::get($asset_type, $namespace);
}
}