PluginsExtension.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. namespace PhpMyAdmin\Twig;
  4. use Twig\Extension\AbstractExtension;
  5. use Twig\TwigFunction;
  6. class PluginsExtension extends AbstractExtension
  7. {
  8. /**
  9. * Returns a list of functions to add to the existing list.
  10. *
  11. * @return TwigFunction[]
  12. */
  13. public function getFunctions()
  14. {
  15. return [
  16. new TwigFunction(
  17. 'checkbox_check',
  18. 'PhpMyAdmin\Plugins::checkboxCheck',
  19. ['is_safe' => ['html']]
  20. ),
  21. new TwigFunction(
  22. 'get_choice',
  23. 'PhpMyAdmin\Plugins::getChoice',
  24. ['is_safe' => ['html']]
  25. ),
  26. new TwigFunction(
  27. 'get_default_plugin',
  28. 'PhpMyAdmin\Plugins::getDefault',
  29. ['is_safe' => ['html']]
  30. ),
  31. new TwigFunction(
  32. 'get_options',
  33. 'PhpMyAdmin\Plugins::getOptions',
  34. ['is_safe' => ['html']]
  35. ),
  36. ];
  37. }
  38. }