FriendsOfSymfony/FOSUserBundle — pull request #1640 by svscorp (2014-10-13 21:56:24+00:00)
Title: Rendering registration template was moved to a separate method

It will help when you need to replace only template display (same way as login).

My points:

I had it and others in app/Resouces before.

But then I had to extend logic of the UserBundle. When I need to have more form fields and do more with data in the action in addition to parent.

In this case I created a controller extending from FOSUserBundle one. Once I've added my custom action Symfony won't take app/Resource template anymore, it throws 'Unable to find template "AcmeDemoBundle:Security:login.html.twig".

1. To override only template rendering part instead of copy-pasting whole method. So the use case:
```
container->getParameter('fos_user.template.engine'));

return $this->container->get('templating')->renderResponse($template, $data);
}
}
```
I think it's better then copying all the code of a function.

2. I can share my custom bundle with other apps. via externals (vendors). If it will be in app/Resource it is not possible to make it external.

3. To keep templates more bundle-oriented (when using the FOSUserBundle went further than overriding one template).

4. Persistence. This way is already used in RegistrationController (method 'renderRegistration'), why not to push a good idea forward? :)