【问题标题】:Symfony form values to arraySymfony 将值转换为数组
【发布时间】:2011-12-13 16:24:41
【问题描述】:

如何在数组中获取表单值而不是这样做

array('field1'=>$this->getValue('field1'), 'field2'=>$this->getValue('field2')...)

【问题讨论】:

    标签: php symfony1 symfony-1.4 symfony-forms


    【解决方案1】:

    你应该试试

    $result = $this->getValues();

    【讨论】:

      【解决方案2】:

      您可以使用$yourform->getValues() 或者表单可以用作数组。在“A Form is an Array”部分下的 more with symfony 阅读更多内容。

      【讨论】:

        猜你喜欢
        • 2014-03-23
        • 2020-05-22
        • 2021-03-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多