本文整理汇总了PHP中EmailField::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailField::setDescription方法的具体用法?PHP EmailField::setDescription怎么用?PHP EmailField::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailField
的用法示例。
在下文中一共展示了EmailField::setDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}