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


PHP AdminInterface::getFormTabs方法代码示例

本文整理汇总了PHP中Sonata\AdminBundle\Admin\AdminInterface::getFormTabs方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminInterface::getFormTabs方法的具体用法?PHP AdminInterface::getFormTabs怎么用?PHP AdminInterface::getFormTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sonata\AdminBundle\Admin\AdminInterface的用法示例。


在下文中一共展示了AdminInterface::getFormTabs方法的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::getFormTabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。