Saturday, August 24, 2013

Symfony2 routing tip

Symfony2 routing tip

Did you ever needed to make the default value to NULL of a routing parameter when using XML for symfony2?
Here is a sample configuration
<route id="acme_user_show" pattern="/{id}">
    <default key="_controller">AcmeUserBundle:User:show</default>
    <default key="id" xsi:nil="true" />
</route>

No comments:

Post a Comment