In a Symfony 3.4 Application I have the following route definition
/**
* @Route("/{_locale}", name="homepage")
* requirements={
* "_locale":"de"
* }
*/
public function indexAction( Request $request, $_locale )
{ ... }
When calling the url
[base]/en
it still just routes into the route ignoring the requirement of _locale to be 'de' only. Switching the ":" in the requirement statement to "=" doesn't help.
The only other route definition I have so far is
/**
* @Route("/", name="base")
*/
public function baseAction(Request $request)
{
return $this->redirectToRoute( 'homepage', array('_locale' => 'de') );
}
Any ideas are very welcome.