QuickForm: setValue instead of setDefaultValue

This commit is contained in:
Thomas Gelf 2015-08-02 12:52:13 +02:00
parent c38a9fcc12
commit 483ba3fbbd

View File

@ -172,10 +172,13 @@ abstract class QuickForm extends Zend_Form
public function addHidden($name, $value = null)
{
$this->addElement('hidden', $name);
$this->getElement($name)->setDecorators(array('ViewHelper'));
$el = $this->getElement($name);
$el->setDecorators(array('ViewHelper'));
if ($value !== null) {
$this->setDefault($name, $value);
$el->setValue($value);
}
return $this;
}