Exemplo n.º 1
1
 public function sendMessage($to, $file, $params = [])
 {
     $view = new View();
     $message = ['from' => $this->from, 'to' => $to, 'to' => '+8618670366212', 'text' => $view->render($file, $params)];
     return;
     //@todo remove
     $this->getTransport()->send($message);
 }
Exemplo n.º 2
0
 /**
  * This View class overrides render and findViewFile
  * to use the theme view files
  */
 public function render($view, $params = array(), $context = null)
 {
     if ($context === null) {
         $context = $this->context;
     }
     return parent::render($view, $params, $context);
 }
Exemplo n.º 3
0
/**
 * @param View $view
 * @param KursExtended $kursRecord
 * @param mixed $tip
 * @return string
 */
function renderRazdelyTipa($view, $kursRecord, $tip)
{
    $ret = '';
    $query = $kursRecord->getRazdelyKursaRel()->orderBy('nomer')->where(['tip' => TipRazdelaKursa::asSql($tip)]);
    foreach ($query->all() as $razdelRecord) {
        $ret .= $view->render('_razdel-kursa', compact('razdelRecord'));
    }
    return $ret;
}
Exemplo n.º 4
0
 /** @inheritdoc */
 public function render($view, $params = [], $context = null)
 {
     /** assign page titles */
     if (!isset($this->title)) {
         $this->title = \Yii::t($this->translations, ucfirst(\Yii::$app->controller->id));
     }
     if (!isset($this->subTitle)) {
         $this->subTitle = \Yii::t($this->translations, ucfirst(\Yii::$app->controller->action->id));
     }
     /** Create an event handler to register page asset as a last one */
     $this->on(self::EVENT_END_BODY, function ($event) {
         /** @var Event $event */
         $sender = $event->sender;
         /** @var self $sender */
         PageAsset::register($sender);
     });
     return parent::render($view, $params, $context);
 }
Exemplo n.º 5
0
 public function render($view, $params = [], $context = null)
 {
     return str_ireplace('garlic', 'g####c', parent::render($view, $params, $context));
 }