I have a Product model and Product controller:
public function actionGet($id) {
Yii::$app->response->format = Yii\web\Response::FORMAT_JSON;
return ['product' => Product::findOne($id)];
}
In my DB, I got products.images column, there's an array with images:
["product.png", "product2.jpg"]
When I do an request to /products/get?id=1, I have a response with the string images, but I need an array with images. How to convert images to array in Product model? Thanks in advance!