1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 11:20:15 +02:00

v2.9 fix twig view syntax in plugin class

This commit is contained in:
trendschau
2024-09-01 21:54:35 +02:00
parent e86595c25d
commit bdc7f451f9
2 changed files with 4 additions and 4 deletions

View File

@@ -236,7 +236,7 @@ class ControllerApiSystemUsers extends Controller
{
$response->getBody()->write(json_encode([
'message' => Translations::translate('Please correct your input.'),
'errors' => $validateErrors
'errors' => $validate->errors
]));
return $response->withHeader('Content-Type', 'application/json')->withStatus(400);

View File

@@ -186,19 +186,19 @@ abstract class Plugin implements EventSubscriberInterface
protected function addTwigGlobal($name, $class)
{
$this->container->view->getEnvironment()->addGlobal($name, $class);
$this->container->get('view')->getEnvironment()->addGlobal($name, $class);
}
protected function addTwigFilter($name, $filter)
{
$filter = new \Twig_SimpleFilter($name, $filter);
$this->container->view->getEnvironment()->addFilter($filter);
$this->container->get('view')->getEnvironment()->addFilter($filter);
}
protected function addTwigFunction($name, $function)
{
$function = new \Twig_SimpleFunction($name, $function);
$this->container->view->getEnvironment()->addFunction($function);
$this->container->get('view')->getEnvironment()->addFunction($function);
}
protected function addJS($JS)