2011-02-16 75 views
1

具有下列路線:Symfony的路由:sf_format默認值

blog_rss_comments: 
    url:  /blog/feeds/:type/comments.:sf_format 
    param: {module: blog, action: feedComments } 
    requirements: { sf_method: get, sf_format: (?:rss|xml|html) } 

是否有可能增加一個默認sf_format設置,所以我沒有通過sf_format每一次?

回答

8

param是您可以放置​​默認值的地方。

param: {module: blog, action: feedComments, sf_format: html }