2017-10-03 17 views
0

私はフロントエンド/ index.phpでCRUDを表示するためにrenderPartialを使用します。しかし、ここでその与えるエラーPHP回復可能なエラー - yii base ErrorExceptionクラスyii web Responseのオブジェクトを文字列に変換できませんでした

PHP Recoverable Error – yii\base\ErrorException 
Object of class yii\web\Response could not be converted to string 

は、コードはC:\ xamppの\ htdocsに\ yii2-私のアプリ\フロントエンド\ビューの\サイトの\ index.phpを

<?= Yii::$app->runAction('/callback/create'); ?> 

C:\ xamppの\ htdocsに\ yii2-私のアプリ\フロントエンド\コントローラCallbackController.php

public function actionCreate() 
    { 
     $model = new Callback(); 
     if ($model->load(Yii::$app->request->post()) && $model->save()) { 
      return $this->redirect(['view', 'id' => $model->id]); 
     } else {  
      return $this->renderPartial('create', [ 
       'model' => $model, 
      ]); 
     } 
    } 

\どのようにエラーを修正する誰もが助けることができますか?

答えて

0
public function actionCreate() 
    { 
     $model = new Callback(); 
     if ($model->load(Yii::$app->request->post()) && $model->save()) { 
      $model = new Callback(); 
      return $this->renderPartial('create', [ 
       'model' => $model, 
      ]);}  
    } 
関連する問題