當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AdminInterface::getFormGroups方法代碼示例

本文整理匯總了PHP中Sonata\AdminBundle\Admin\AdminInterface::getFormGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminInterface::getFormGroups方法的具體用法?PHP AdminInterface::getFormGroups怎麽用?PHP AdminInterface::getFormGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sonata\AdminBundle\Admin\AdminInterface的用法示例。


在下文中一共展示了AdminInterface::getFormGroups方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testWithFieldsCascadeTranslationDomain

 public function testWithFieldsCascadeTranslationDomain()
 {
     $this->admin->setModelManager($this->modelManager);
     $this->modelManager->expects($this->once())->method('getNewFieldDescriptionInstance')->with('class', 'foo', array('translation_domain' => 'Foobar', 'type' => 'bar'))->will($this->returnValue($this->fieldDescription));
     $this->contractor->expects($this->once())->method('getDefaultOptions')->will($this->returnValue(array()));
     $this->admin->setLabelTranslatorStrategy($this->labelTranslatorStrategy);
     $this->formMapper->with('foobar', array('translation_domain' => 'Foobar'))->add('foo', 'bar')->end();
     $this->assertSame(array('default' => array('collapsed' => false, 'class' => false, 'description' => false, 'translation_domain' => 'Foobar', 'name' => 'default', 'auto_created' => true, 'groups' => array('foobar'), 'tab' => true)), $this->admin->getFormTabs());
     $this->assertSame(array('foobar' => array('collapsed' => false, 'class' => false, 'description' => false, 'translation_domain' => 'Foobar', 'name' => 'foobar', 'fields' => array('foo' => 'foo'))), $this->admin->getFormGroups());
 }
開發者ID:LamaDelRay,項目名稱:test_symf,代碼行數:10,代碼來源:FormMapperTest.php

示例2: testWithFieldsCascadeTranslationDomain

 public function testWithFieldsCascadeTranslationDomain()
 {
     $this->contractor->expects($this->once())->method('getDefaultOptions')->will($this->returnValue(array()));
     $this->formMapper->with('foobar', array('translation_domain' => 'Foobar'))->add('foo', 'bar')->end();
     $fieldDescription = $this->admin->getFormFieldDescription('foo');
     $this->assertEquals('foo', $fieldDescription->getName());
     $this->assertEquals('bar', $fieldDescription->getType());
     $this->assertEquals('Foobar', $fieldDescription->getTranslationDomain());
     $this->assertTrue($this->formMapper->has('foo'));
     $this->assertEquals(array('default' => array('collapsed' => false, 'class' => false, 'description' => false, 'translation_domain' => 'Foobar', 'auto_created' => true, 'groups' => array('foobar'), 'tab' => true, 'name' => 'default', 'box_class' => 'box box-primary')), $this->admin->getFormTabs());
     $this->assertEquals(array('foobar' => array('collapsed' => false, 'class' => false, 'description' => false, 'translation_domain' => 'Foobar', 'fields' => array('foo' => 'foo'), 'name' => 'foobar', 'box_class' => 'box box-primary')), $this->admin->getFormGroups());
 }
開發者ID:0mars,項目名稱:SonataAdminBundle,代碼行數:12,代碼來源:FormMapperTest.php

示例3: testGroupRemovingWithTabAndWithTabRemoving

 public function testGroupRemovingWithTabAndWithTabRemoving()
 {
     $this->formMapper->tab('mytab')->with('foobar');
     $this->formMapper->removeGroup('foobar', 'mytab', true);
     $this->assertSame(array(), $this->admin->getFormGroups());
     $this->assertSame(array(), $this->admin->getFormTabs());
 }
開發者ID:robhunt3r,項目名稱:SonataAdminBundle,代碼行數:7,代碼來源:FormMapperTest.php


注:本文中的Sonata\AdminBundle\Admin\AdminInterface::getFormGroups方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。