本文整理匯總了PHP中Tab::fieldPosition方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tab::fieldPosition方法的具體用法?PHP Tab::fieldPosition怎麽用?PHP Tab::fieldPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tab
的用法示例。
在下文中一共展示了Tab::fieldPosition方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testInsertAfterWithNestedTabsets
/**
* @todo check actual placement of fields
*/
function testInsertAfterWithNestedTabsets()
{
$fieldSetA = new FieldSet($tabSetA = new TabSet('TabSet_A', $tabA1 = new Tab('Tab_A1', new TextField('A_pre'), new TextField('A'), new TextField('A_post')), $tabB1 = new Tab('Tab_B1', new TextField('B'))));
$tabSetA->insertAfter($A_insertafter = new TextField('A_insertafter'), 'A');
$this->assertEquals($fieldSetA->dataFieldByName('A_insertafter'), $A_insertafter, 'Field on toplevel tab can be inserted after');
$this->assertEquals(0, $tabA1->fieldPosition('A_pre'));
$this->assertEquals(1, $tabA1->fieldPosition('A'));
$this->assertEquals(2, $tabA1->fieldPosition('A_insertafter'));
$this->assertEquals(3, $tabA1->fieldPosition('A_post'));
$fieldSetB = new FieldSet(new TabSet('TabSet_A', $tabsetB = new TabSet('TabSet_B', $tabB1 = new Tab('Tab_B1', new TextField('C')), $tabB2 = new Tab('Tab_B2', new TextField('B_pre'), new TextField('B'), new TextField('B_post')))));
$fieldSetB->insertAfter($B_insertafter = new TextField('B_insertafter'), 'B');
$this->assertSame($fieldSetB->dataFieldByName('B_insertafter'), $B_insertafter, 'Field on nested tab can be inserted after');
$this->assertEquals(0, $tabB2->fieldPosition('B_pre'));
$this->assertEquals(1, $tabB2->fieldPosition('B'));
$this->assertEquals(2, $tabB2->fieldPosition('B_insertafter'));
$this->assertEquals(3, $tabB2->fieldPosition('B_post'));
}
示例2: fieldPosition
/**
* @inheritdoc
*/
public function fieldPosition($field)
{
return $this->tab->fieldPosition($field);
}