本文整理汇总了PHP中TextareaField::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP TextareaField::setDescription方法的具体用法?PHP TextareaField::setDescription怎么用?PHP TextareaField::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextareaField
的用法示例。
在下文中一共展示了TextareaField::setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Contact Form settings
$recipient_field = new EmailField('DefaultRecipient', 'Email recipient');
$recipient_field->setDescription('Default email address to send submissions to.');
$subject_field = new TextField('Subject', 'Email subject');
$subject_field->setDescription('Subject for the email.');
$default_from_field = new EmailField('DefaultFrom', 'Email from');
$default_from_field->setDescription('Default from email address.');
$fields->addFieldToTab('Root.ContactForm.Settings', $recipient_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $subject_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $default_from_field);
// Contact Form fields
$conf = GridFieldConfig_RelationEditor::create(10);
$conf->addComponent(new GridFieldSortableRows('SortOrder'));
$data_columns = $conf->getComponentByType('GridFieldDataColumns');
$data_columns->setDisplayFields(array('Name' => 'Name', 'Type' => 'Type', 'requiredText' => 'Required'));
$contact_form_fields = new GridField('Fields', 'Field', $this->ContactFields(), $conf);
$fields->addFieldToTab('Root.ContactForm.Fields', $contact_form_fields);
// Recipient map
$contact_fields = array();
foreach ($this->ContactFields() as $contact_field) {
$contact_fields[$contact_field->Name] = $contact_field->Name;
}
$recipient_map_field_field = new DropdownField('RecipientMapField', 'Recipient Map Field', $contact_fields);
$recipient_map_field_field->setDescription('Field used to map recipients.');
$recipient_map_field = new TextareaField('RecipientMap', 'Recipient Map');
$recipient_map_field->setDescription('Map field values to an email address (format: value:email address) one per line.');
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field_field);
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field);
return $fields;
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$name_field = new TextField('Name', 'Field Name');
$type_field = new DropdownField('Type', 'Field Type', array('TextField' => 'Text', 'EmailField' => 'Email', 'TextareaField' => 'Textarea', 'DropdownField' => 'Dropdown'));
$required_field = new DropdownField('Required', 'Field Required', array(1 => 'Yes', 0 => 'No'));
$values_field = new TextareaField('Values', 'Field Values');
$values_field->setDescription('Values for dropdown type one per line.');
$fields->addFieldToTab('Root.Main', $name_field);
$fields->addFieldToTab('Root.Main', $type_field);
$fields->addFieldToTab('Root.Main', $required_field);
$fields->addFieldToTab('Root.Main', $values_field);
$fields->removeFieldFromTab('Root.Main', 'ContactPage');
$fields->removeFieldFromTab('Root.Main', 'SortOrder');
return $fields;
}
开发者ID:helpfulrobot,项目名称:chtombleson-silverstripe-streamline,代码行数:16,代码来源:StreamLineContactFormField.php
示例3: setPipelineConfigurationFields
/**
* @param FieldList $fields
*/
protected function setPipelineConfigurationFields($fields)
{
if (!$this->config()->get('allow_web_editing')) {
return;
}
$config = $this->pipelineFileExists() ? file_get_contents($this->getPipelineFilename()) : '';
$deployConfig = new TextareaField('PipelineConfig', 'Pipeline config', $config);
$deployConfig->setRows(40);
if (!$this->pipelineFileExists()) {
$deployConfig->setDescription("No pipeline is configured for this environment. Saving content here will generate a new template.");
}
$fields->addFieldsToTab('Root.PipelineSettings', array(FieldGroup::create(CheckboxField::create('DryRunEnabled', 'Enable dry-run?'))->setTitle('Pipeline Options')->setDescription("Allows admins to run simulated pipelines without triggering deployments or notifications."), $deployConfig));
}