Unable to save a model by assigning values to each attributes in Yii -
$model=new testmodel; $data = $_get['data']; //get json object ajax request $record = json_decode($data); //convert json objects $model->url = $record['info']['bg']; //assign url $model->user_id = 123; //assign user id $model->save(); the error says: cannot use object of type stdclass array in.
can explain me why error occurs? new yii
$record = json_decode($data, true); mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] )
Comments
Post a Comment