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


PHP ReadonlyField::setDescription方法代码示例

本文整理汇总了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;
 }
开发者ID:ss23,项目名称:deploynaut,代码行数:23,代码来源:DNProject.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-staticsiteconnector,代码行数:23,代码来源:StaticSiteContentSource.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-deploynaut,代码行数:31,代码来源:DNProject.php


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