Forms 通过zend framework设置值以形成构建

Forms 通过zend framework设置值以形成构建,forms,zend-framework,edit,Forms,Zend Framework,Edit,我使用Zend framework构建表单,我想进行编辑操作,因为用户点击编辑,表单显示用户数据,我如何将数据设置为动态构建的表单 $form->populate($data); 其中,$data是包含数据的键值对数组 $form = new Zend_Form; if ($this->_request->isPost()) { //to just populate $form->populate($this->_getAllParams());

我使用Zend framework构建表单,我想进行编辑操作,因为用户点击编辑,表单显示用户数据,我如何将数据设置为动态构建的表单

$form->populate($data);
其中,$data是包含数据的键值对数组

$form = new Zend_Form;

if ($this->_request->isPost()) {
   //to just populate
   $form->populate($this->_getAllParams());

   //or auto populate during validation
   if ($form->isValid($this->_getAllParams()) {
      //do stuff if valid
   }
}
其中,$data是包含数据的键值对数组

$form = new Zend_Form;

if ($this->_request->isPost()) {
   //to just populate
   $form->populate($this->_getAllParams());

   //or auto populate during validation
   if ($form->isValid($this->_getAllParams()) {
      //do stuff if valid
   }
}
我知道ZF maunal相当混乱,并非所有内容都清楚,但我认为表单的解释非常好(有示例)。你应该自己做更多的研究

我知道ZF maunal相当混乱,并非所有内容都清楚,但我认为表单的解释非常好(有示例)。你应该自己做更多的研究