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.
48 lines
1.2 KiB
48 lines
1.2 KiB
<?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']] |
|
), |
|
]; |
|
} |
|
}
|
|
|