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


PHP CBaseController::renderInternal方法代碼示例

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


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

示例1: send

 public function send()
 {
     //		$this->body = (new CController('__MAIL__'))->renderPartial( Yii::app()->basePath .'application.widgets.mailSender.views.'.$this->view,$this->dataArray, true);
     $this->body = CBaseController::renderInternal(Yii::app()->basePath . '/widgets/mailSender/views/' . $this->view . '.php', $this->dataArray, true);
     $mailer = Yii::createComponent('application.extensions.mailer.EMailer');
     $mailer->From = $this->from;
     $mailer->FromName = $this->from_name;
     if (is_array($this->recipient)) {
         foreach ($this->recipient as $key => $recipient) {
             $mailer->AddAddress($recipient);
         }
     } elseif (is_string($this->recipient)) {
         $mailer->AddAddress($this->recipient);
     }
     $mailer->isHTML($this->html);
     $mailer->Subject = $this->subject;
     $mailer->Body = $this->body;
     $mailer->CharSet = 'UTF-8';
     if ($this->attachments) {
         foreach ($this->attachments as $key => $attachment) {
             $mailer->AddAttachment($attachment['file_path'], $attachment['file_name']);
         }
     }
     $result = $mailer->Send();
     return $result;
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:26,代碼來源:mailSender.php

示例2: renderFile

 /**
  * Renders a view file.
  * This method is required by {@link IViewRenderer}.
  * @param CBaseController $context the controller or widget who is rendering the view file.
  * @param string $sourceFile the view file path
  * @param mixed $data the data to be passed to the view
  * @param boolean $return whether the rendering result should be returned
  * @return mixed the rendering result, or null if the rendering result is not needed.
  */
 public function renderFile($context, $sourceFile, $data, $return)
 {
     if (!is_file($sourceFile) || ($file = realpath($sourceFile)) === false) {
         throw new CException(Yii::t('yii', 'View file "{file}" does not exist.', array('{file}' => $sourceFile)));
     }
     $viewFile = $this->getViewFile($sourceFile);
     if (@filemtime($sourceFile) > @filemtime($viewFile)) {
         $this->generateViewFile($sourceFile, $viewFile);
         @chmod($viewFile, $this->filePermission);
     }
     return $context->renderInternal($viewFile, $data, $return);
 }
開發者ID:charlymanja,項目名稱:traceper,代碼行數:21,代碼來源:CViewRenderer.php

示例3: actionMilestonesPending

 public function actionMilestonesPending()
 {
     $Milestones = Milestones::model()->MilestoneWithPendingTasks();
     foreach ($Milestones as $milestone) {
         $Tasks = Tasks::model()->findTaskByMilestone($milestone->milestone_id);
         $str = CBaseController::renderInternal(Yii::app()->params['templatesPath'] . '/milestones/overdueMilestones.php', array('user' => $milestone->Users->completeName, 'tasks' => $Tasks, 'applicationName' => Yii::app()->name, 'applicationUrl' => "http://localhost/celestic/" . Yii::app()->request->baseUrl), true);
         $subject = Yii::t('email', 'overdueMilestone');
         Yii::import('application.extensions.phpMailer.yiiPhpMailer');
         $mailer = new yiiPhpMailer();
         $mailer->pushMail($subject, $str, array('name' => $milestone->Users->CompleteName, 'email' => $milestone->Users->user_email), Emails::PRIORITY_NORMAL);
     }
 }
開發者ID:lanzelotik,項目名稱:celestic-community,代碼行數:12,代碼來源:BackgroundCommand.php

示例4: render

 protected function render($view, $data)
 {
     return CBaseController::renderInternal(Yii::app()->basePath . '/widgets/MainMenu/views/' . $view . '.php', array('data' => $data, 'controller' => $this->current_controller), true);
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:4,代碼來源:MainMenu.php


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