I'm kind of new in Symfony2 Framework. This error take forever me to solved. I build my own project based from Jobeet tutorial. Now I've success till generate CRUD but 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 "sifo_mst_periode_show" must match "[^/]++" ("" given) to generate a corresponding URL.") in SifoSchoolBundle:MstPeriode:index.html.twig at line 21.
This is my index.html.twig line 21 :
<td><a href="{{ path('sifo_mst_periode_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
This is the route :
sifo_mst_periode:
pattern: /
defaults: { _controller: "SifoSchoolBundle:MstPeriode:index" }
sifo_mst_periode_show:
pattern: /{id}/show
defaults: { _controller: "SifoSchoolBundle:MstPeriode:show" }
And this is the routing :
SifoSchoolBundle_sifo_mst_periode:
resource: "@SifoSchoolBundle/Resources/config/routing/mstperiode.yml"
prefix: /periode
entity.idhave some value - xiideaentity? If its in a loop make sure you check ifentity.idis empty or null! - PCoder