Split extension into extension and runtime classes to match how the maker bundle creates twig extensions
This commit is contained in:
22
src/Twig/Extension/IconExtension.php
Normal file
22
src/Twig/Extension/IconExtension.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pcm\IconBundle\Twig\Extension;
|
||||
|
||||
use Pcm\IconBundle\Twig\Runtime\IconRuntime;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
final class IconExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new TwigFunction('icon', [IconRuntime::class, 'renderIcon'])
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user