本文整理汇总了PHP中TabSet::rootFieldList方法的典型用法代码示例。如果您正苦于以下问题:PHP TabSet::rootFieldList方法的具体用法?PHP TabSet::rootFieldList怎么用?PHP TabSet::rootFieldList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabSet
的用法示例。
在下文中一共展示了TabSet::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());
}