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


PHP EmailField::setDescription方法代码示例

本文整理汇总了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;
 }
开发者ID:helpfulrobot,项目名称:chtombleson-silverstripe-streamline,代码行数:33,代码来源:StreamLineContactPage.php


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