I am currently creating a package that can rename fooAction to fooAjaxAction if the request is an Ajax request. As the answer to this question suggests , I have to extend the controller class. I have ResourceNotFoundExceptionif I change control_resolver.class in config.yml. but if I do not, I have no errors (but no redefinition, so this is not what I want)
My questions are: how can I register my new controller and use it? I'm not wrong? Wrong?
This is what I did:
You can find my bundle for testing in packagist and download it via:
composer require "/prefix-bundle":"dev-dev"
activate it in AppKernel.php:
<?php
new \PrefixBundle\PrefixBundle()
Configuration
parameters:
controller_resolver.class: PrefixBundle\Component\Controller\ControllerResolver
So this is my user controller.
<?php
namespace \PrefixBundle\Component\Controller;
use Symfony\Component\HttpKernel\ControllerControllerResolver as BaseControllerResolver;
use Symfony\Component\HttpFoundation\Request;
class ControllerResolver extends BaseControllerResolver
{
public function getArguments(Request $request, $controller)
{
parent::getArguments($request, $controller);
}
}
, , , .