i'm working on symfony2 project, when opening index page I got route error like this :
An exception has been thrown during the rendering of a template ("Parameter "id" for route "gmjob_examination_front_view" must match "[^/]" ("4719" given).") in GmjobExaminationBundle:Front:list.html.twig at line 25.
This is my list.html.twig line 25 :
<a href="{{ path(view.mainRouteName, view.mainRouteParams) }}"><h2>{{ view.title }}</h2></a>
This is the route annotation:
* @Route("/detail-concours/{id}/{slug}", requirements = {"id" = "[^/]"})
here are the two methods of examination class Entity:
public function getMainRouteName()
{
return 'gmjob_examination_front_view';
}
public function getMainRouteParams()
{
return array(
'id' => $this->id,
'slug' => $this->slug
);
}
I appreciate your help. Thank you before.