Because I would like to override the templates of the FOS UserBundle in Symfony2, I am trying to adapt my custom UserBundle.
I made templates (and followed the exact same structure as the FOS bundle) and I've made an "empty" extension for every controller.
However, as soon as I make the override active, clear the cache and attempt to login, there is an error and I don't understand why. The error reads:
An exception has been thrown during the rendering of a template ("Route "login" does not exist.") in "FOSUserBundle:Security:login.html.twig".
This is my own SecurityController for example:
<?php
namespace R\Bundle\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\SecurityController as BaseController;
class SecurityController extends BaseController
{ }
By activating the override (before clearing the cache), I mean uncommenting this line:
<?php
namespace R\Bundle\UserBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class RUserBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle'; <-- this line activates or deactivates the override
}
}
The login.html.twig template in my own UserBundle, which is supposed to override the one in the FOS UserBundle, is still an exact copy of the original one (which functions fine if the override is not active).
I assume I somehow need to override the routing files as well, but if I copy them into my custom UserBundle the error remains.