yii\base\Controller::renderPartial PHP Method

renderPartial() public method

This method differs from Controller::render in that it does not apply any layout.
public renderPartial ( 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 renderPartial($view, $params = [])
    {
        return $this->getView()->render($view, $params, $this);
    }

Usage Example

 public function actionGet_product_view()
 {
     if (Yii::$app->request->isAjax) {
         $id = $_POST['id'];
         $response['update_view'] = \yii\base\Controller::renderPartial('view', ['model' => $this->findModel($id)]);
         return json_encode($response);
     }
 }
All Usage Examples Of yii\base\Controller::renderPartial