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


PHP SSViewer::execute_template方法代码示例

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


在下文中一共展示了SSViewer::execute_template方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: format

 /**
  * Format the exported data as YAML.
  * 
  * @param \ArrayData $templateData
  * @return void
  */
 public function format($templateData)
 {
     $viewer = SSViewer::execute_template('WorkflowDefinitionExport', $templateData);
     // Temporary until we find the source of the replacement in SSViewer
     $processed = str_replace('&', '&', $viewer);
     // Clean-up newline "gaps" that SSViewer leaves behind from the placement of template control structures
     return preg_replace("#^\\R+|^[\t\\s]*\\R+#m", '', $processed);
 }
开发者ID:Neumes,项目名称:advancedworkflow,代码行数:14,代码来源:WorkflowDefinitionExporter.php

示例2: one

 public function one(SS_HTTPRequest $request)
 {
     $this->header();
     $hash = $request->param('hash');
     $data = new ViewableData();
     $data->Error = Error::get()->filter('Hash', $hash)->limit(1)->first();
     $data->ErrorOccurances = ErrorOccurance::get()->filter('Hash', $hash)->sort('Created DESC');
     echo SSViewer::execute_template('ErrorDetail', $data);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-devtools,代码行数:9,代码来源:DevErrorLogsController.php

示例3: Field

 /**
  * Render the cart with editable item fields.
  *
  * @param array $properties
  */
 public function Field($properties = array())
 {
     $editables = $this->editableItems();
     $customcartdata = array('Items' => $editables);
     // NOTE: this was originally incorrect - passing just $editables and $customcartdata
     // which broke modules like Display_Logic.
     $this->extend('onBeforeRender', $this, $editables, $customcartdata);
     return SSViewer::execute_template($this->template, $this->cart->customise($customcartdata), array('Editable' => true));
 }
开发者ID:NobrainerWeb,项目名称:silverstripe-shop,代码行数:14,代码来源:CartEditField.php

示例4: getColumnContent

 /**
  *
  * @param \GridField $gridField
  * @param \DataObject $record
  * @param string $columnName
  * @return string|null - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record instanceof \Payment) {
         return null;
     }
     \Requirements::css('omnipay-ui/css/omnipay-ui-cms.css');
     \Requirements::javascript('omnipay-ui/javascript/omnipay-ui-cms.js');
     if (preg_match('/Pending(Capture|Void|Refund)/', $record->Status)) {
         return \SSViewer::execute_template('PaymentPendingIndicator', \ArrayData::create(array('StatusLink' => \Controller::join_links($gridField->Link('checkPaymentPending')), 'PaymentID' => $record->ID, 'Timeout' => 2000)));
     }
     return null;
 }
开发者ID:bummzack,项目名称:silverstripe-omnipay-ui,代码行数:19,代码来源:GridFieldPaymentStatusIndicator.php

示例5: process

 public function process()
 {
     $fromTime = $this->since ? $this->since : 0;
     $members = $this->members;
     $nextId = array_shift($members);
     $this->members = $members;
     $member = Member::get()->byID($nextId);
     $microBlogService = $this->microBlogService;
     // if we don't have a 'since' time, we need to only scan from 'now' onwards, to prevent _every_
     // post from being collected
     if (!$fromTime) {
         $fromTime = time();
     }
     $since = date('Y-m-d 00:00:00', $fromTime);
     if ($member && $member->ID) {
         $this->transactionManager->run(function () use($microBlogService, $since, $member) {
             $posts = $microBlogService->globalFeed(array('ParentID' => 0, 'ThreadOwnerID:not' => $member->ID, 'Created:GreaterThan' => $since), $orderBy = 'ID DESC', $since = null, $number = 10, $markViewed = false);
             if (!count($posts)) {
                 return;
             }
             $content = SSViewer::execute_template('DigestEmail', ArrayData::create(array('Posts' => $posts, 'Member' => $member)));
             $content = HTTP::absoluteURLs($content);
             $config = SiteConfig::current_site_config();
             $mail = new Email();
             $mail->setTo($member->Email);
             $mail->setBody($content);
             $mail->setSubject($config->Title . ' digest');
             if ($config->FromEmail) {
                 $mail->setFrom($config->FromEmail);
             }
             $mail->send();
         }, $member);
     }
     $this->currentStep++;
     if (count($members) == 0) {
         if (!$this->sendTime) {
             $this->sendTime = '23:55:00';
         }
         $nextTime = $this->type == 'weekly' ? '+1 week' : '+1 day';
         $nextDate = date('Y-m-d ' . $this->sendTime, strtotime($nextTime));
         $nextJob = new MicroPostDigestJob(time(), $this->type, $this->groupId, $this->sendTime);
         singleton('QueuedJobService')->queueJob($nextJob, $nextDate);
         $this->isComplete = true;
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-microblog,代码行数:45,代码来源:MicroPostDigestJob.php

示例6: index

 public function index()
 {
     echo SSViewer::execute_template('DevToolsIndex', null);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-devtools,代码行数:4,代码来源:DevToolsController.php

示例7: digest

 public function digest()
 {
     if (!Permission::check('ADMIN')) {
         return $this->httpError(403);
     }
     $posts = $this->microBlogService->globalFeed(array('Created:GreaterThan' => date('Y-m-d 00:00:00', strtotime('-1 month'))), $orderBy = 'ID DESC', $since = null, $number = 10, $markViewed = false);
     if (!count($posts)) {
         return;
     }
     $content = SSViewer::execute_template('DigestEmail', ArrayData::create(array('Posts' => $posts, 'Member' => Member::currentUser())));
     $content = HTTP::absoluteURLs($content);
     echo $content;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-microblog,代码行数:13,代码来源:TimelineController.php

示例8: __construct

 public function __construct($controller, $name = "CartForm", $cart = null, $template = "Cart")
 {
     $this->cart = $cart;
     parent::__construct($controller, $name, new FieldList(LiteralField::create("cartcontent", SSViewer::execute_template($template, $cart->customise(array('Items' => $this->editableItems($cart->Items()))), array('Editable' => true)))), new FieldList(FormAction::create("updatecart", "Update Cart")));
 }
开发者ID:8secs,项目名称:cocina,代码行数:5,代码来源:CartForm.php

示例9: securityAction

 public function securityAction()
 {
     $this->header();
     $data = new ViewableData();
     echo SSViewer::execute_template('DevInfoSecurity', $data);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-devtools,代码行数:6,代码来源:DevInfoController.php


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