可能重复:
Symfony - Form requested url not found
我在做一个symfony项目。我正在与一个不会重定向到它自己的页面的表单进行斗争。action属性设置为"“,方法设置为post。在这种情况下,它应该调用相同的页面,但我在404页上结束。
有趣的是,当我从它的url调用页面时,它就会正确地出现,404只会在提交表单时追加。
当我在shell中运行:php symfony app:routes frontend时,它说方法被设置为head和get。但是它甚至没有在routing.yml中设置,如果我在路由中提出任何要求,404仍然会出现。这是我的路线:
stories_detail:
url: /stories-of-the-month/:slug
class: sfDoctrineRoute
param: { module: stories, action: detail}
options: { model: Article, type: object, method: doSelectForSlug }
requirements:
sf_method: any如何使页面接受post方法?
发布于 2012-01-03 06:54:35
默认情况下,sfDoctrineRoute对象只接受get/head请求,这是初学者的常见缺陷。这是正确的要求:
sf_method: [get, post]https://stackoverflow.com/questions/8707996
复制相似问题