在文檔中使用了2種語法。用':'或'='分隔這些值。有什麼區別嗎?在Symfony(2.3)中,路由註釋中的equals和冒號有什麼區別嗎?
http://symfony.com/doc/2.3/book/routing.html
/**
* @Route(
* "/articles/{_locale}/{year}/{title}.{_format}",
* defaults={"_format": "html"},
* requirements={
* "_locale": "en|fr",
* "_format": "html|rss",
* "year": "\d+"
* }
*)
*/
http://symfony.com/doc/2.3/bundles/SensioFrameworkExtraBundle/annotations/routing.html
* @Route("/{id}", requirements={"id" = "\d+"}, defaults={"id" = 1})
是的,這符合我們的經驗。 – Interlated