本文整理汇总了PHP中yii\web\View::render方法的典型用法代码示例。如果您正苦于以下问题:PHP View::render方法的具体用法?PHP View::render怎么用?PHP View::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\web\View
的用法示例。
在下文中一共展示了View::render方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* 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);
}
示例2: sendMessage
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);
}
示例3: renderRazdelyTipa
/**
* @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;
}
示例4: render
/** @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);
}
示例5: render
public function render($view, $params = [], $context = null)
{
return str_ireplace('garlic', 'g####c', parent::render($view, $params, $context));
}