Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url symfony:如果找不到对象,则sfDoctrineRoute不应匹配_Url_Symfony1_Routing_Doctrine_Symfony 1.4 - Fatal编程技术网

Url symfony:如果找不到对象,则sfDoctrineRoute不应匹配

Url symfony:如果找不到对象,则sfDoctrineRoute不应匹配,url,symfony1,routing,doctrine,symfony-1.4,Url,Symfony1,Routing,Doctrine,Symfony 1.4,sfDoctrineRoute能够转发404,或者如果找不到任何对象,则只传递任何对象给操作。如果没有找到任何对象,那么如果路径根本不匹配,那就更有意义了 有时,您无法避免为一个模式使用多个模块,例如,如果您使用slug: url: /:slug 我认为对于这种模式使用多个模块不是最佳做法,但有时我需要这样做,因为客户端需要一个特定的url模式 如果找不到对象,sfDoctrineRoute是否提供与路由不匹配的选项 如果没有,我如何修改sfDoctrineRoute以实现该行为?我试图重写m

sfDoctrineRoute能够转发404,或者如果找不到任何对象,则只传递任何对象给操作。如果没有找到任何对象,那么如果路径根本不匹配,那就更有意义了

有时,您无法避免为一个模式使用多个模块,例如,如果您使用slug:

url: /:slug
我认为对于这种模式使用多个模块不是最佳做法,但有时我需要这样做,因为客户端需要一个特定的url模式

如果找不到对象,sfDoctrineRoute是否提供与路由不匹配的选项


如果没有,我如何修改sfDoctrineRoute以实现该行为?我试图重写matchesParameter(),但没有效果。即使我把
die()
在方法的第一行,调用操作。

不使用sfDoctrineRoute不是更容易吗? 为什么不提出尽可能多的请求,并在发现问题时转发到正确的模块/操作