Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

44 rindas
975B

  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. new TwigFunction('getUnitsList', [$this, 'getUnitsList']),
  19. );
  20. }
  21. public function getFilters()
  22. {
  23. return [
  24. ];
  25. }
  26. public function getDayByNumber($number)
  27. {
  28. return $this->utils->getDayByNumber($number) ;
  29. }
  30. public function getUnitsList()
  31. {
  32. return $this->utils->getUnitsList() ;
  33. }
  34. }