D
D
des1roer2016-03-22 18:25:03
Yii
des1roer, 2016-03-22 18:25:03

Yii 2 redirect not working?

default redirect stopped working. save works but stays on the same page
after saving bare page
EmgXCCW.png

public function actionCreate()
    {
        $model = new Country();

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

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question