本文整理匯總了PHP中FieldSet::removeFieldsFromTab方法的典型用法代碼示例。如果您正苦於以下問題:PHP FieldSet::removeFieldsFromTab方法的具體用法?PHP FieldSet::removeFieldsFromTab怎麽用?PHP FieldSet::removeFieldsFromTab使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FieldSet
的用法示例。
在下文中一共展示了FieldSet::removeFieldsFromTab方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testRemoveMultipleFieldsFromTab
/**
* Test removing an array of fields from a tab in a set.
*/
function testRemoveMultipleFieldsFromTab()
{
$fields = new FieldSet();
$tab = new Tab('Root');
$fields->push($tab);
/* We add an array of fields, using addFieldsToTab() */
$fields->addFieldsToTab('Root', array(new TextField('Name', 'Your name'), new EmailField('Email', 'Email address'), new NumericField('Number', 'Insert a number')));
/* We have 3 fields inside the tab, which we just created */
$this->assertEquals(3, $tab->Fields()->Count());
/* We remove the 3 fields from the tab */
$fields->removeFieldsFromTab('Root', array('Name', 'Email', 'Number'));
/* We have no fields in the tab now */
$this->assertEquals(0, $tab->Fields()->Count());
}
示例2: updateCMSFields
public function updateCMSFields(FieldSet &$fields) {
//Set default
if($this->owner->GenerateMetaData == -1){
$this->owner->GenerateMetaData = self::$checkbox_state;
}
if(empty(self::$checkbox_tab)) {
self::$checkbox_tab = 'Root.Content.Metadata';
}
if(self::$show_checkbox == 1){
$fields->addFieldToTab(self::$checkbox_tab, new CheckboxField('GenerateMetaData', _t('MetaManager.GENERATEMETADATA','Generate Meta-data automatically from the page content') . self::updatedFields() , $this->owner->GenerateMetaData), self::$checkbox_pos);
} else {
$fields->addFieldToTab(self::$checkbox_tab, new HiddenField('GenerateMetaData', _t('MetaManager.GENERATEMETADATA','Generate Meta-data automatically from the page content'), $this->owner->GenerateMetaData), self::$checkbox_pos);
}
if(self::$hide_extra_meta == 1){
$fields->removeFieldsFromTab('Root.Content.Metadata', array('ExtraMeta'));
}
if(self::$disable_update_popup == 1){
Requirements::clear('sapphire/javascript/UpdateURL.js');
if(self::$update_url == 1){
Requirements::javascript('metamanager/javascript/UpdateURL.js');
}
}
}