I'm currently updating one of my projects from Symfony2 to Symfony3. Most of the work is done but there is some kind of error I don't understand.
For the routing configuration file, I read the official documentation (http://symfony.com/doc/current/book/routing.html#adding-http-method-requirements) which is telling me to write this configuration :
corbins_characters_new_character:
path: /characters/new
defaults: { _controller: CorbinsCharacterBundle:Character:new }
requirements:
methods: [GET]
corbins_characters_new_character:
path: /characters
defaults: { _controller: CorbinsCharacterBundle:Character:create }
requirements:
methods: [POST]
But when I do, I have the following error :
Routing requirement for "methods" must be a string in C:\Developpement\Symfony2\Corbins_V3\src\Corbins\CharacterBundle/Resources/config/routing.yml (which is being imported from "C:\Developpement\Symfony2\Corbins_V3\app/config\routing.yml").
InvalidArgumentException: Routing requirement for "methods" must be a string.
- in vendor\symfony\symfony\src\Symfony\Component\Routing\Route.php at line 571
I was going to create a new issue for Symfony but first I want to ask for help here :D !
Any idea ?
requirements
key is parsed (which isn't present in your example route). – xabbuh