symfony 1.4路由与sf_format

symfony 1.4路由与sf_format

问题描述:

我正在做移动检测和设置sf_format'移动'根据these instructionssymfony 1.4路由与sf_format

但我无法为移动格式创建单独的路由。是否有可能有两个具有相同网址的路线?以下设置不适用于我:

mobile_homepage: 
    url:/
    param: { module: mobile, action: index, sf_format: html } 
    requirements: 
    sf_format: mobile 

homepage: 
    url:/
    param: { module: site, action: index } 

无论sf_format如何,mobile_hpage页面路由始终匹配。

当你写

param: { module: mobile, action: index, sf_format: html } 

你设置了 'sf_format' 到 'HTML' 这个URL。只需写

param: { module: mobile, action: index } 

改为。

此外,当您用 “要求” 它应该被用来像这里写:

http://www.symfony-project.org/blog/2008/06/09/how-to-create-an-optimized-version-of-your-website-for-the-iphone-in-symfony-1-1

+0

这只是它。即使sf_format设置为'html',它仍然会匹配mobile_homepage路线。 – gruner 2011-01-10 21:30:52