gl-website-deployer/admin/phpMyAdmin/libraries/classes/Twig/UrlExtension.php
2024-11-23 20:45:29 +01:00

49 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Twig;
use PhpMyAdmin\Url;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class UrlExtension extends AbstractExtension
{
/**
* Returns a list of functions to add to the existing list.
*
* @return TwigFunction[]
*/
public function getFunctions()
{
return [
new TwigFunction(
'get_hidden_inputs',
[Url::class, 'getHiddenInputs'],
['is_safe' => ['html']]
),
new TwigFunction(
'get_hidden_fields',
[Url::class, 'getHiddenFields'],
['is_safe' => ['html']]
),
new TwigFunction(
'get_common',
[Url::class, 'getCommon'],
['is_safe' => ['html']]
),
new TwigFunction(
'get_common_raw',
[Url::class, 'getCommonRaw'],
['is_safe' => ['html']]
),
new TwigFunction(
'url',
[Url::class, 'getFromRoute'],
['is_safe' => ['html']]
),
];
}
}