【发布时间】:2015-04-15 03:04:03
【问题描述】:
文档中使用了 2 种语法。用 ':' 或 '=' 分隔值。有什么区别吗?
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})
【问题讨论】: