base\View renderFile()

renderFile() public method

Renders a view file.

If $theme is enabled (not null), it will try to render the themed version of the view file as long as it is available.

The method will call yii\helpers\FileHelper::localize() to localize the view file.

If renderer is enabled (not null), the method will use it to render the view file. Otherwise, it will simply include the view file as a normal PHP file, capture its output and return it as a string.

public string renderFile ( $viewFile, $params = [], $context = null )
$viewFile string

The view file. This can be either an absolute file path or an alias of it.

$params array

The parameters (name-value pairs) that will be extracted and made available in the view file.

$context object

The context that the view should use for rendering the view. If null, existing $context will be used.

return string

The rendering result

throws yii\base\ViewNotFoundException

if the view file does not exist

doc_Yii
2016-10-30 16:52:36
Comments
Leave a Comment

Please login to continue.