Reputation: 645
I'm trying to add a new route on a controller, and I ran into a problem when using an email parameter:
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/foo/{email}", methods="GET")
*
* @param string $email
*
* @return JsonResponse
*/
public function fooAction(string $email) {
return JsonResponse::create('OK!');
}
It seems that Symfony routing doesn't allow .
.
Do I need to add something to make it works?
Upvotes: 0
Views: 121
Reputation: 1147
You should solve that with a regex, trys something like this answer
Hope it helps!
Upvotes: 0
Reputation: 645
ok it's because I'm in a dev env, and I start the server using
php -S 127.0.0.1:8000 -t public
using symfony/web-server-bundle it works
Upvotes: 1
Reputation: 840
Try to end the route with '/'
@Route("/foo/{email}/", methods="GET")
Upvotes: 0