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:
@@ -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);
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user