在 symfony 2.3 中,使用 bind()
将 Request
绑定(bind)到一个表单是不推荐的:
$form->bind($this->getRequest());
现在我尝试使用 submit()
方法(如 documentation 中所述):
$form->submit($request->request->get($form->getName()));
...但它不起作用。
表单没有更改我在创建时添加到其中的对象。
最佳答案
Passing the Request directly to submit() still works, but is deprecated and will be removed in Symfony 3.0. You should use the method handleRequest() instead.
( documentation )
关于php - 表单处理 : "bind" is deprecated in symfony 2. 3 - "submit"也不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18740990/