当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form::clearDisplayGroups方法代码示例

本文整理汇总了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));
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:8,代码来源:FormTest.php

示例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'));
 }
开发者ID:nbcutech,项目名称:o3drupal,代码行数:21,代码来源:FormTest.php

示例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);
     }
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:32,代码来源:FormTest.php


注:本文中的Zend_Form::clearDisplayGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。