當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EmailField::setForm方法代碼示例

本文整理匯總了PHP中EmailField::setForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP EmailField::setForm方法的具體用法?PHP EmailField::setForm怎麽用?PHP EmailField::setForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EmailField的用法示例。


在下文中一共展示了EmailField::setForm方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateEditForm

 public function updateEditForm(Form $form)
 {
     if (($record = $form->getRecord()) instanceof SiteTree) {
         if (!$record->numChildren()) {
             return;
         }
     }
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('siteexporter/javascript/SiteExportAdmin.js');
     $action = new FormAction('doExport');
     $action->useButtonTag = true;
     $action->setButtonContent('Export');
     $exports = new TableListField('SiteExports', 'SiteExport', null, sprintf('"ParentClass" = \'%s\' AND "ParentID" =  %d', ClassInfo::baseDataClass($form->getRecord()->class), $form->getRecord()->ID));
     $exports->setFieldFormatting(array('Archive.Name' => '<a href=\\"{$Archive()->Link()}\\">{$Archive()->Name}</a>'));
     $exports->setForm($form);
     $fields = array(new HeaderField('ExportSiteHeader', 'Export Site As Zip'), new OptionSetField('ExportSiteBaseUrlType', 'Base URL type', array('fixed' => 'Set the site base URL to a fixed value', 'rewrite' => 'Attempt to rewrite URLs to be relative'), 'fixed'), new TextField('ExportSiteBaseUrl', 'Base URL', Director::absoluteBaseURL()), new DropdownField('ExportSiteTheme', 'Theme', SiteConfig::current_site_config()->getAvailableThemes(), null, null, '(Use default theme)'), $action, new HeaderField('SiteExportsHeader', 'Site Exports'), $exports);
     $form->Fields()->addFieldsToTab('Root.Export', $fields);
     if (class_exists('QueuedJobService')) {
         $form->Fields()->addFieldToTab('Root.Export', new LiteralField('ExporSiteQueuedNote', '<p>The site export' . ' will not be performed immediately, but will be ' . ' processed in the background as a queued job. You can' . ' enter an email address below to send a notification' . ' email to when the job is complete:</p>'), 'action_doExport');
         $email = new EmailField('ExportSiteCompleteEmail', 'Notification email address');
         $email->setForm($form);
         $form->Fields()->addFieldToTab('Root.Export', $email, 'action_doExport');
     }
 }
開發者ID:rodneyway,項目名稱:silverstripe-siteexporter,代碼行數:24,代碼來源:SiteExportExtension.php


注:本文中的EmailField::setForm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。