Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.3 |
After upgrading to 3.3 and enabling Controllers' autoimport i'm got error about empty controller argument.
services.yml:
services:
_defaults:
autowire: true
autoconfigure: true
public: false
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
index.html.twig:
{{ render(controller('AppBundle:Products:list')) }}
ProductsController.php
/**
* @Template()
* @param Serializer $serializer
* @param Translator $translator
* @param Request $request
* @return array
*/
public function listAction(
Serializer $serializer,
Translator $translator,
Request $request
) {
// ...
}
Error text:
RuntimeException
An exception has been thrown during the rendering of a template ("Controller "AppBundle\Controller\ProductsController::listAction()" requires that you provide a value for the "$serializer" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.").
How can I fix this error? Manually pass all services? Or its my configuration issue?
Metadata
Metadata
Assignees
Labels
No labels