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


PHP ArrayHelper::prependOrAppend方法代码示例

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


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

示例1: includeJs

 /**
  * Prepares JS for inclusion in the template.
  *
  * @param string $js    The Javascript code.
  * @param bool   $first Whether the Javascript code should be included before any other Javascript code that was
  *                      already included with this method.
  *
  * @return null
  */
 public function includeJs($js, $first = false)
 {
     // Trim any whitespace and ensure it ends with a semicolon.
     $js = trim($js, " \t\n\r\v;") . ';';
     $latestBuffer =& $this->_jsBuffers[count($this->_jsBuffers) - 1];
     ArrayHelper::prependOrAppend($latestBuffer, $js, $first);
 }
开发者ID:andyra,项目名称:tes,代码行数:16,代码来源:TemplatesService.php

示例2: includeJs

 /**
  * Prepares JS for inclusion in the template.
  *
  * @param string $js    The Javascript code.
  * @param bool   $first Whether the Javascript code should be included before any other Javascript code that was
  *                      already included with this method.
  *
  * @return null
  */
 public function includeJs($js, $first = false)
 {
     $latestBuffer =& $this->_jsBuffers[count($this->_jsBuffers) - 1];
     ArrayHelper::prependOrAppend($latestBuffer, trim($js), $first);
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:14,代码来源:TemplatesService.php

示例3: includeJs

 /**
  * Prepares JS for inclusion in the template.
  *
  * @param           $js
  * @param bool|null $first
  * @return void
  */
 public function includeJs($js, $first = false)
 {
     ArrayHelper::prependOrAppend($this->_js, trim($js), $first);
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:11,代码来源:TemplatesService.php

示例4: sendEmailNotification

 /**
  * Send Email Notification
  *
  */
 public function sendEmailNotification($form, $files, $postData, $customEmail, $customSubject, $message, $html = true, $email = null)
 {
     $errors = false;
     $attributes = $form->getAttributes();
     $notificationSettings = $attributes['notificationSettings'];
     $toEmails = ArrayHelper::stringToArray($notificationSettings['emailSettings']['notifyEmail']);
     $emailSettings = craft()->email->getSettings();
     if (isset($notificationSettings['replyTo']) && $notificationSettings['replyTo'] != '') {
         $replyTo = $postData[$notificationSettings['replyTo']];
     } else {
         $replyTo = $emailSettings['emailAddress'];
     }
     // Process Subject Line
     if ($customSubject) {
         $subject = $customSubject;
     } else {
         $subject = $notificationSettings['emailSettings']['emailSubject'];
     }
     if ($customEmail != '') {
         $theEmailAddress = explode('|', $customEmail);
         ArrayHelper::prependOrAppend($toEmails, $theEmailAddress[0], true);
     }
     foreach ($toEmails as $toEmail) {
         $email = new EmailModel();
         $email->fromEmail = $emailSettings['emailAddress'];
         $email->replyTo = $replyTo;
         $email->sender = $emailSettings['emailAddress'];
         $email->fromName = $form->name;
         $email->toEmail = $toEmail;
         $email->subject = $subject;
         $email->htmlBody = $message;
         // Attach files to email
         if (!empty($files)) {
             foreach ($files as $attachment) {
                 $email->addAttachment($attachment['tempPath'], $attachment['filename'], 'base64', $attachment['type']);
             }
         }
         if (!craft()->email->sendEmail($email)) {
             $errors = true;
         }
     }
     return $errors ? false : true;
 }
开发者ID:roundhouse,项目名称:FormBuilder-2-Craft-CMS,代码行数:47,代码来源:FormBuilder2_EntryService.php


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