minor #21209 [SecurityBundle] removed usage of the templating component (fabpot)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] removed usage of the templating component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

17240eb7e8 [SecurityBundle] removed usage of the templating component
This commit is contained in:
Fabien Potencier 2017-01-08 15:07:02 -08:00
commit e6bd47e457
10 changed files with 13 additions and 17 deletions

View File

@ -24,14 +24,14 @@ class LoginController implements ContainerAwareInterface
{
$form = $this->container->get('form.factory')->create('Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginType');
return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:login.html.twig', array(
return new Response($this->container->get('twig')->render('@CsrfFormLogin/Login/login.html.twig', array(
'form' => $form->createView(),
));
)));
}
public function afterLoginAction()
{
return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:after_login.html.twig');
return new Response($this->container->get('twig')->render('@CsrfFormLogin/Login/after_login.html.twig'));
}
public function loginCheckAction()

View File

@ -1,4 +1,4 @@
{% extends "::base.html.twig" %}
{% extends "base.html.twig" %}
{% block body %}
Hello {{ app.user.username }}!<br /><br />

View File

@ -1,4 +1,4 @@
{% extends "::base.html.twig" %}
{% extends "base.html.twig" %}
{% block body %}

View File

@ -30,11 +30,11 @@ class LocalizedController implements ContainerAwareInterface
$error = $request->getSession()->get(Security::AUTHENTICATION_ERROR);
}
return $this->container->get('templating')->renderResponse('FormLoginBundle:Localized:login.html.twig', array(
return new Response($this->container->get('twig')->render('@FormLogin/Localized/login.html.twig', array(
// last username entered by the user
'last_username' => $request->getSession()->get(Security::LAST_USERNAME),
'error' => $error,
));
)));
}
public function loginCheckAction()

View File

@ -32,16 +32,16 @@ class LoginController implements ContainerAwareInterface
$error = $request->getSession()->get(Security::AUTHENTICATION_ERROR);
}
return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:login.html.twig', array(
return new Response($this->container->get('twig')->render('@FormLogin/Login/login.html.twig', array(
// last username entered by the user
'last_username' => $request->getSession()->get(Security::LAST_USERNAME),
'error' => $error,
));
)));
}
public function afterLoginAction(UserInterface $user)
{
return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:after_login.html.twig', array('user' => $user));
return new Response($this->container->get('twig')->render('@FormLogin/Login/after_login.html.twig', array('user' => $user)));
}
public function loginCheckAction()

View File

@ -1,4 +1,4 @@
{% extends "::base.html.twig" %}
{% extends "base.html.twig" %}
{% block body %}

View File

@ -1,4 +1,4 @@
{% extends "::base.html.twig" %}
{% extends "base.html.twig" %}
{% block body %}
Hello {{ user.username }}!<br /><br />

View File

@ -1,4 +1,4 @@
{% extends "::base.html.twig" %}
{% extends "base.html.twig" %}
{% block body %}

View File

@ -1,6 +1,3 @@
framework:
templating: { engines: ['twig'] }
# Twig Configuration
twig:
debug: '%kernel.debug%'

View File

@ -32,7 +32,6 @@
"symfony/framework-bundle": "~3.1",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/templating": "~2.8|~3.0",
"symfony/twig-bundle": "~2.8|~3.0",
"symfony/twig-bridge": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",