Add SponsorsExtension
This commit is contained in:
parent
d0774d1408
commit
e3ba387f86
|
@ -1 +1,5 @@
|
||||||
services:
|
services:
|
||||||
|
twig.app.sponsors:
|
||||||
|
class: 'App\Sponsors\TwigExtension\SponsorsExtension'
|
||||||
|
tags:
|
||||||
|
- { name: twig.extension }
|
||||||
|
|
26
src/Sponsors/src/TwigExtension/SponsorsExtension.php
Normal file
26
src/Sponsors/src/TwigExtension/SponsorsExtension.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Sponsors\TwigExtension;
|
||||||
|
|
||||||
|
use App\Sponsors\Model\Sponsor;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
|
class SponsorsExtension extends AbstractExtension
|
||||||
|
{
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return 'app.sponsors';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFunctions()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
new TwigFunction('getSponsors', [$this, 'getSponsors'])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSponsors(array $sponsorData, string $level): array
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue