2amigos / yii2-grid-view-library

Highly enhanced GridView widget and grid components for Yii2
https://2amigos.us
Other
57 stars 16 forks source link

yii\base\InvalidParamException with message "Response content must not be an array." #8

Closed johnluxor closed 10 years ago

johnluxor commented 10 years ago

Last commit has broken code in Toggle Action class. If model was saved successfully then will not set response format to JSON and I got error

yii\base\InvalidParamException with message "Response content must not be an array."

kevingatp commented 7 years ago

Hi sir, I got the same error, and I just add the code like your suggestion. But I still got the same. Can you help me, may be you can check my code. Because I'm not sure I've put the code in the right place.

This is my code https://github.com/kepingatp/pstk/blob/master/ToggleAction.php Thanks.

0xvbetsun commented 7 years ago

try to use this before return \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;