Use Twig globals to pass registration_enabled

This commit is contained in:
Yassine Guedidi 2022-05-05 23:12:44 +02:00
parent 5a55a64fee
commit bfc28d4c0b
3 changed files with 2 additions and 27 deletions

View file

@ -41,6 +41,8 @@ twig:
form_themes:
- "LexikFormFilterBundle:Form:form_div_layout.html.twig"
exception_controller: wallabag_core.exception_controller:showAction
globals:
registration_enabled: '%fosuser_registration%'
# Doctrine Configuration
doctrine:

View file

@ -41,12 +41,6 @@ homepage:
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
fos_user_security_login:
path: /login
defaults:
_controller: Wallabag\UserBundle\Controller\SecurityController::loginAction
methods: [GET, POST]
fos_user_registration_register:
path: /register
defaults:

View file

@ -1,21 +0,0 @@
<?php
namespace Wallabag\UserBundle\Controller;
use FOS\UserBundle\Controller\SecurityController as FOSSecurityController;
/**
* Extends login form in order to pass the registration_enabled parameter.
*/
class SecurityController extends FOSSecurityController
{
protected function renderLogin(array $data)
{
return $this->render('FOSUserBundle:Security:login.html.twig',
array_merge(
$data,
['registration_enabled' => $this->container->getParameter('fosuser_registration')]
)
);
}
}