I have a routing pattern in which the last parameter is filled from a multiline input field. When I call the route without line break, everything works, but I get an error when I have a linebreak (which is escaped as %0A):
No route found for "GET /update/1/complete/Kommentar%3Daa%0Abb%7C"
The routing definition:
_update:
pattern: /update/{id}/{column}/{newvalue}
defaults: { _controller: MyBundle:Auftrag:update, newvalue: ' ' }
requirements:
id: \d+
newvalue: ".+"
My controller definition is:
public function updateAction($id, $column, $newvalue) {
}
you should be aware that according to the REST idea you don’t initiate a change via GET. For update you would use POST for example and then your newline-problem is solved.
I also made the experience that urlencoded chars will get interpreted. For example a urlencoded slash gets interpreted as a path separator. Don’t know why, I guess it’s due to server settings at the end of the day. So the solution would be there somewhere.
If you insist to use your way you could replace problem chars by combinations of “,”,”-“,”_”. but that would be just a hack. use POST instead for the transmitted data.