php - 表单处理 : "bind" is deprecated in symfony 2. 3 - "submit"也不起作用

标签 php forms symfony

在 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/

相关文章:

php - 根据复选框编辑中间表

php - 如何从 php 注册 ejabberd 用户?

javascript - 如何在 vuelidate 中设置验证规则使其具有与对象字段相同的值?

即使表单中有字段,PHP 表单也会返回错误

php - Symfony 2 + 类似 Twitter 的 ajax 加载更多内容

php - Symfony 请求获取所有 url 参数

php - 在数据库中保存多个值,在 PHP 中使用行

javascript - Ajax 调用在移动设备中返回 0 作为响应

PHP 表单生成和验证独立类

php - Symfony2 使用 besimple/soap-client 包使用 SOAP 服务