|
12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
-
- namespace Lc\ShopBundle\Twig;
-
- use Lc\ShopBundle\Services\Utils;
- use Twig\Extension\AbstractExtension;
- use Twig\TwigFilter;
- use Twig\TwigFunction;
-
- class BridgeTwigExtension extends AbstractExtension
- {
- private $utils ;
-
- public function __construct(Utils $utils)
- {
- $this->utils = $utils ;
- }
-
- public function getFunctions()
- {
- return array(
- new TwigFunction('getDayByNumber', [$this, 'getDayByNumber']),
- );
- }
-
- public function getFilters()
- {
- return [
- ];
- }
-
- public function getDayByNumber($number)
- {
- return $this->utils->getDayByNumber($number) ;
- }
-
- }
|