How to pass default value for a parameter in Symfony routing.
Sometimes we need to pass a default to any of the passed parameter in a Symfony Routing. Thankfully Symfony Routing has this option as to set in 2nd parameter. Below is how to do this :
While registering a router :
While registering a router :
1 2 3 | acme_read_company: path: /company_read/{id} defaults: { _controller: "AcmeDemoBundle:Default:readCompany", id:0 } |
Comments