yii\web\View::renderAjax PHP Метод

renderAjax() публичный Метод

This method is similar to [[render()]] except that it will surround the view being rendered with the calls of [[beginPage()]], View::head, View::beginBody, View::endBody and View::endPage. By doing so, the method is able to inject into the rendering result with JS/CSS scripts and files that are registered with the view.
См. также: render()
public renderAjax ( string $view, array $params = [], object $context = null ) : string
$view string the view name. Please refer to [[render()]] on how to specify this parameter.
$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.
Результат string the rendering result
    public function renderAjax($view, $params = [], $context = null)
    {
        $viewFile = $this->findViewFile($view, $context);
        ob_start();
        ob_implicit_flush(false);
        $this->beginPage();
        $this->head();
        $this->beginBody();
        echo $this->renderFile($viewFile, $params, $context);
        $this->endBody();
        $this->endPage(true);
        return ob_get_clean();
    }