本文整理汇总了PHP中Zend_Form::setConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form::setConfig方法的具体用法?PHP Zend_Form::setConfig怎么用?PHP Zend_Form::setConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form
的用法示例。
在下文中一共展示了Zend_Form::setConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetConfigSetsObjectState
public function testSetConfigSetsObjectState()
{
$config = new Zend_Config($this->getOptions());
$this->form->setConfig($config);
$this->assertEquals('foo', $this->form->getName());
$this->assertEquals('someform', $this->form->getAttrib('class'));
$this->assertEquals('/foo/bar', $this->form->getAction());
$this->assertEquals('put', $this->form->getMethod());
}
示例2: build
public static function build($formConfig)
{
$decorators = array();
if ($formConfig->useInternalError) {
$decorators[] = new Saf_Form_Zend_Helper_Error(array('class' => 'formErrors', 'id' => $newFormId . 'Errors', 'placement' => 'append', 'escape' => false));
}
$newForm = new Zend_Form();
$newForm->setConfig($formConfig);
$newForm->removeDecorator('HtmlTag');
$newFormId = $newForm->getId();
$formDecorator = $newForm->getDecorator('Form');
$elementDecorator = $newForm->getDecorator('FormElements');
$decorators[] = $elementDecorator;
$decorators[] = $formDecorator;
$newForm->setDecorators($decorators);
foreach ($newForm->getElements() as $element) {
self::fixElement($element);
}
return $newForm;
}