本文整理汇总了PHP中ReadonlyField::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP ReadonlyField::setDescription方法的具体用法?PHP ReadonlyField::setDescription怎么用?PHP ReadonlyField::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReadonlyField
的用法示例。
在下文中一共展示了ReadonlyField::setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
/**
*
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$environments = $fields->dataFieldByName("Environments");
$fields->fieldByName("Root")->removeByName("Viewers");
$fields->fieldByName("Root")->removeByName("Environments");
$fields->fieldByName("Root")->removeByName("LocalCVSPath");
$fields->dataFieldByName('DiskQuotaMB')->setDescription('This is the maximum amount of disk space (in megabytes) that all environments within this project can use for stored snapshots');
$fields->fieldByName('Root.Main.Name')->setTitle('Project name')->setDescription('Changing the name will <strong>reset</strong> the deploy configuration and avoid using non alphanumeric characters');
$fields->fieldByName('Root.Main.CVSPath')->setTitle('Git repository')->setDescription('E.g. git@github.com:silverstripe/silverstripe-installer.git');
$workspaceField = new ReadonlyField('LocalWorkspace', 'Git workspace', $this->getLocalCVSPath());
$workspaceField->setDescription('This is where the GIT repository are located on this server');
$fields->insertAfter($workspaceField, 'CVSPath');
$readAccessGroups = ListboxField::create('Viewers', 'Project viewers', Group::get()->map()->toArray())->setMultiple(true)->setDescription('These groups can view the project in the front-end.');
$fields->addFieldToTab("Root.Main", $readAccessGroups);
$this->setCreateProjectFolderField($fields);
$this->setEnvironmentFields($fields, $environments);
return $fields;
}
示例2: getCMSFields
/**
*
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$dataType = $this->Schema()->DataType;
if ($dataType) {
$fieldList = singleton($dataType)->inheritedDatabaseFields();
$fieldList = array_combine(array_keys($fieldList), array_keys($fieldList));
unset($fieldList->ParentID);
unset($fieldList->WorkflowDefinitionID);
unset($fieldList->Version);
$fieldNameField = new DropdownField("FieldName", "Field Name", $fieldList);
$fieldNameField->setEmptyString("(choose)");
$fields->insertBefore($fieldNameField, "CSSSelector");
} else {
$fields->replaceField('FieldName', $fieldName = new ReadonlyField("FieldName", "Field Name"));
$fieldName->setDescription('Save this rule before being able to add a field name');
}
return $fields;
}
示例3: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
/** @var GridField $environments */
$environments = $fields->dataFieldByName("Environments");
$fields->fieldByName("Root")->removeByName("Viewers");
$fields->fieldByName("Root")->removeByName("Environments");
$fields->fieldByName("Root")->removeByName("LocalCVSPath");
$diskQuotaDesc = 'This is the maximum amount of disk space (in megabytes) that all environments within this ' . 'project can use for stored snapshots';
$fields->dataFieldByName('DiskQuotaMB')->setDescription($diskQuotaDesc);
$projectNameDesc = 'Changing the name will <strong>reset</strong> the deploy configuration and avoid using non' . 'alphanumeric characters';
$fields->fieldByName('Root.Main.Name')->setTitle('Project name')->setDescription($projectNameDesc);
$fields->fieldByName('Root.Main.CVSPath')->setTitle('Git repository')->setDescription('E.g. git@github.com:silverstripe/silverstripe-installer.git');
$workspaceField = new ReadonlyField('LocalWorkspace', 'Git workspace', $this->getLocalCVSPath());
$workspaceField->setDescription('This is where the GIT repository are located on this server');
$fields->insertAfter($workspaceField, 'CVSPath');
$readAccessGroups = ListboxField::create('Viewers', 'Project viewers', Group::get()->map()->toArray())->setMultiple(true)->setDescription('These groups can view the project in the front-end.');
$fields->addFieldToTab("Root.Main", $readAccessGroups);
$this->setCreateProjectFolderField($fields);
$this->setEnvironmentFields($fields, $environments);
$environmentTypes = ClassInfo::implementorsOf('EnvironmentCreateBackend');
$types = array();
foreach ($environmentTypes as $type) {
$types[$type] = $type;
}
$fields->addFieldsToTab('Root.Main', array(DropdownField::create('AllowedEnvironmentType', 'Allowed Environment Type', $types)->setDescription('This defined which form to show on the front end for ' . 'environment creation. This will not affect backend functionality.')->setEmptyString(' - None - ')));
return $fields;
}