本文整理匯總了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);
}
}