You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
778B

  1. <?php
  2. namespace Lc\ShopBundle\Twig;
  3. use Lc\ShopBundle\Services\Utils;
  4. use Twig\Extension\AbstractExtension;
  5. use Twig\TwigFilter;
  6. use Twig\TwigFunction;
  7. class BridgeTwigExtension extends AbstractExtension
  8. {
  9. private $utils ;
  10. public function __construct(Utils $utils)
  11. {
  12. $this->utils = $utils ;
  13. }
  14. public function getFunctions()
  15. {
  16. return array(
  17. new TwigFunction('getDayByNumber', [$this, 'getDayByNumber']),
  18. );
  19. }
  20. public function getFilters()
  21. {
  22. return [
  23. ];
  24. }
  25. public function getDayByNumber($number)
  26. {
  27. return $this->utils->getDayByNumber($number) ;
  28. }
  29. }