本文整理匯總了PHP中Zend\Form\Form::setBaseFieldset方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::setBaseFieldset方法的具體用法?PHP Form::setBaseFieldset怎麽用?PHP Form::setBaseFieldset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\Form\Form
的用法示例。
在下文中一共展示了Form::setBaseFieldset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCorrectlyHydrateBaseFieldsetWhenHydratorThatDoesNotIgnoreInvalidDataIsUsed
public function testCorrectlyHydrateBaseFieldsetWhenHydratorThatDoesNotIgnoreInvalidDataIsUsed()
{
$fieldset = new Fieldset('example');
$fieldset->add(array('name' => 'foo'));
// Add an hydrator that ignores if values does not exist in the
$fieldset->setObject(new Entity\SimplePublicProperty());
$fieldset->setHydrator(new \Zend\Stdlib\Hydrator\ObjectProperty());
$this->form->add($fieldset);
$this->form->setBaseFieldset($fieldset);
$this->form->setHydrator(new \Zend\Stdlib\Hydrator\ObjectProperty());
// Add some inputs that do not belong to the base fieldset
$this->form->add(array('type' => 'Zend\\Form\\Element\\Submit', 'name' => 'submit'));
$object = new Entity\SimplePublicProperty();
$this->form->bind($object);
$this->form->setData(array('submit' => 'Confirm', 'example' => array('foo' => 'value example')));
$this->assertTrue($this->form->isValid());
// Make sure the object was not hydrated at the "form level"
$this->assertFalse(isset($object->submit));
}