yii\web\Controller::renderAjax PHP Method

renderAjax() public method

This method is similar to [[renderPartial()]] except that it will inject into the rendering result with JS/CSS scripts and files which are registered with the view. For this reason, you should use this method instead of [[renderPartial()]] to render a view to respond to an AJAX request.
public renderAjax ( string $view, array $params = [] ) : string
$view string the view name. Please refer to [[render()]] on how to specify a view name.
$params array the parameters (name-value pairs) that should be made available in the view.
return string the rendering result.
    public function renderAjax($view, $params = [])
    {
        return $this->getView()->renderAjax($view, $params, $this);
    }