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


PHP Tab::rootFieldList方法代码示例

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


在下文中一共展示了Tab::rootFieldList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testrootFieldList

 public function testrootFieldList()
 {
     /* Given a nested set of FormField, CompositeField, and FieldList objects */
     $FieldList = new FieldList($root = new TabSet("Root", $main = new Tab("Main", $a = new TextField("A"), $b = new TextField("B"))));
     /* rootFieldList() should always evaluate to the same object: the topmost FieldList */
     $this->assertSame($FieldList, $FieldList->rootFieldList());
     $this->assertSame($FieldList, $root->rootFieldList());
     $this->assertSame($FieldList, $main->rootFieldList());
     $this->assertSame($FieldList, $a->rootFieldList());
     $this->assertSame($FieldList, $b->rootFieldList());
     /* If we push additional fields, they should also have the same rootFieldList() */
     $root->push($other = new Tab("Other"));
     $other->push($c = new TextField("C"));
     $root->push($third = new Tab("Third", $d = new TextField("D")));
     $this->assertSame($FieldList, $other->rootFieldList());
     $this->assertSame($FieldList, $third->rootFieldList());
     $this->assertSame($FieldList, $c->rootFieldList());
     $this->assertSame($FieldList, $d->rootFieldList());
 }
开发者ID:normann,项目名称:sapphire,代码行数:19,代码来源:FieldListTest.php


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