Y
Y
Yuri Smith2017-07-06 12:33:05
Yii
Yuri Smith, 2017-07-06 12:33:05

Why is it not saved when updating a record in yii2 with symbols?

There was such a problem.
When you add a smiley symbol, the entry is updated and becomes empty, i.e. all text disappears and there is an empty line.
The code itself was generated via yii.
Action code:

public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-07-06
@nixxels

Good afternoon.
Check what comes in the request
print_r(Yii::$app->request->post());

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question