本文整理汇总了PHP中Zend_Form::clearDisplayGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form::clearDisplayGroups方法的具体用法?PHP Zend_Form::clearDisplayGroups怎么用?PHP Zend_Form::clearDisplayGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form
的用法示例。
在下文中一共展示了Zend_Form::clearDisplayGroups方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCanClearAllDisplayGroups
public function testCanClearAllDisplayGroups()
{
$this->testCanAddAndRetrieveMultipleDisplayGroups();
$this->form->clearDisplayGroups();
$groups = $this->form->getDisplayGroups();
$this->assertTrue(is_array($groups));
$this->assertTrue(empty($groups));
}
示例2: testAddElementToDisplayGroupByElementInstance
/**
* @group ZF-10491
* @group ZF-10734
* @group ZF-10731
*/
public function testAddElementToDisplayGroupByElementInstance()
{
$element = new Zend_Form_Element_Text('foo');
$elementTwo = new Zend_Form_Element_Text('baz-----');
$this->form->addElements(array($element, $elementTwo));
$this->form->addDisplayGroup(array($element, $elementTwo), 'bar');
$displayGroup = $this->form->getDisplayGroup('bar');
$this->assertNotNull($displayGroup->getElement('foo'));
$this->assertNotNull($displayGroup->getElement('baz'));
// clear display groups and elements
$this->form->clearDisplayGroups()->clearElements();
$this->form->addDisplayGroup(array($element, $elementTwo), 'bar');
$displayGroup = $this->form->getDisplayGroup('bar');
$this->assertNotNull($displayGroup->getElement('foo'));
$this->assertNotNull($displayGroup->getElement('baz'));
}
示例3: testClearingAttachedItemsShouldNotCauseIterationToRaiseExceptions
public function testClearingAttachedItemsShouldNotCauseIterationToRaiseExceptions()
{
$form = new Zend_Form();
$form->addElements(array('username' => 'text', 'password' => 'text'));
$form->clearElements();
try {
foreach ($form as $item) {
}
} catch (Zend_Form_Exception $e) {
$message = "Clearing elements prior to iteration should not cause iteration to fail;\n" . $e->getMessage();
$this->fail($message);
}
$form->addElements(array('username' => 'text', 'password' => 'text'))->addDisplayGroup(array('username', 'password'), 'login');
$form->clearDisplayGroups();
try {
foreach ($form as $item) {
}
} catch (Zend_Form_Exception $e) {
$message = "Clearing display groups prior to iteration should not cause iteration to fail;\n" . $e->getMessage();
$this->fail($message);
}
$subForm = new Zend_Form_SubForm();
$form->addSubForm($subForm, 'foo');
$form->clearSubForms();
try {
foreach ($form as $item) {
}
} catch (Zend_Form_Exception $e) {
$message = "Clearing sub forms prior to iteration should not cause iteration to fail;\n" . $e->getMessage();
$this->fail($message);
}
}