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


PHP FormAction::setButtonContent方法代码示例

本文整理汇总了PHP中FormAction::setButtonContent方法的典型用法代码示例。如果您正苦于以下问题:PHP FormAction::setButtonContent方法的具体用法?PHP FormAction::setButtonContent怎么用?PHP FormAction::setButtonContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormAction的用法示例。


在下文中一共展示了FormAction::setButtonContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例2: SearchForm

 public function SearchForm()
 {
     $searchText = $this->GetSearchTerm() ?: "";
     $queryType = $this->GetSearchType() ?: "";
     $category = $this->GetCategory() ?: "";
     $searchField = new TextField('Search', "Search youtube for:", $searchText);
     $searchField->setAttribute('placeholder', "Type here");
     $fields = new FieldList(new DropdownField('queryType', "Search type:", array('relevance' => 'All Videos', 'viewcount' => 'Most Viewed Videos', 'date' => 'Most recent', 'rating' => 'Top rated'), $queryType), new DropdownField('category', "Category:", $this->GetCategories(), $category), $searchField);
     $action = new FormAction('YouTubeSearchResults', _t('SearchForm.GO', 'Go'));
     $action->addExtraClass('btn btn-default btn-search');
     $action->useButtonTag = true;
     $action->setButtonContent('<i class="fa fa-search"></i><span class="text-hide">Search</span>');
     $actions = new FieldList($action);
     $form = new Form($this, 'YouTubeSearchForm', $fields, $actions);
     $form->setFormMethod('GET');
     $form->setFormAction($this->Link() . "");
     $form->disableSecurityToken();
     return $form;
 }
开发者ID:helpfulrobot,项目名称:gdmedia-silverstripe-youtube-page,代码行数:19,代码来源:YouTubePage.php


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