UrlExtension.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * hold PhpMyAdmin\Twig\UrlExtension class
  5. *
  6. * @package PhpMyAdmin\Twig
  7. */
  8. namespace PhpMyAdmin\Twig;
  9. use Twig\Extension\AbstractExtension;
  10. use Twig\TwigFunction;
  11. /**
  12. * Class UrlExtension
  13. *
  14. * @package PhpMyAdmin\Twig
  15. */
  16. class UrlExtension extends AbstractExtension
  17. {
  18. /**
  19. * Returns a list of functions to add to the existing list.
  20. *
  21. * @return TwigFunction[]
  22. */
  23. public function getFunctions()
  24. {
  25. return array(
  26. new TwigFunction(
  27. 'Url_getHiddenInputs',
  28. 'PhpMyAdmin\Url::getHiddenInputs',
  29. array('is_safe' => array('html'))
  30. ),
  31. new TwigFunction(
  32. 'Url_getHiddenFields',
  33. 'PhpMyAdmin\Url::getHiddenFields',
  34. array('is_safe' => array('html'))
  35. ),
  36. new TwigFunction(
  37. 'Url_getCommon',
  38. 'PhpMyAdmin\Url::getCommon',
  39. array('is_safe' => array('html'))
  40. ),
  41. new TwigFunction(
  42. 'Url_getCommonRaw',
  43. 'PhpMyAdmin\Url::getCommonRaw',
  44. array('is_safe' => array('html'))
  45. ),
  46. new TwigFunction(
  47. 'Url_link',
  48. 'PhpMyAdmin\Core::linkURL'
  49. ),
  50. );
  51. }
  52. }