public render ( string $view, array $params = [], object $context = null ) : string | ||
$view | string | the view name. |
$params | array | the parameters (name-value pairs) that will be extracted and made available in the view file. |
$context | object | the context to be assigned to the view and can later be accessed via [[context]] in the view. If the context implements [[ViewContextInterface]], it may also be used to locate the view file corresponding to a relative view name. |
return | string | the rendering result |
public function render($view, $params = [], $context = null)
{
$viewFile = $this->findViewFile($view, $context);
return $this->renderFile($viewFile, $params, $context);
}
public function render($view, $params = [], $context = null) { if ($this->id === null) { throw new \Exception("The ActiveWindow View 'id' can't be empty!"); } if ($this->module === null) { throw new \Exception("The ActiveWindow View 'module' can't be empty!"); } if ($context === null) { $context = new \admin\ngrest\base\ViewContext(); $context->module = $this->module; $context->id = $this->id; } return parent::render($view, $params, $context); }