简体   繁体   中英

Route problems on symfony 2.6

I'm a beginner with symfony and I got my first route problem.

My controller is :

/**
* Dossier controller.
*
* @Route("/dossier")
*/
class DossierController extends Controller

Inside my class, I want to create a new route for an admin on this route :

  • @Route("/gestionnaire/etatcivil", name="etat_civil")
  • @Method("GET")

But I got a 404 not found on this adress. All the other URL are correct and work fine, it's the only route I have a problem with!

Is there someone who has any clue ?

Thanks !

You can debug your routes with the command app/console router:debug for list every routes and then check one route like this: app/console router:debug etat_civil
You can also try your routes with app/console router:match /dossier for exemple.

The answer is simple. (I answer to myself)

The name cannot be the same of another name. I just change "etat_civil" by something else and it was good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM