A
A
andr20172016-08-16 10:43:33
Yii
andr2017, 2016-08-16 10:43:33

How to redirect a request to a controller in Yii using a non-standard url?

In the action of the form I use the following url: docs/index.php?r=search/index, how to redirect the user to the pages: http://docs/index.php?r=search/index&query=query text ?
When a request is sent, it goes to docs/index.php?query=wawa

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-08-16
@andr2017

/**
 * Экшен осуществляющий редирект
 *
 * @return \yii\web\Response
 */
public function actionExampe()
{
    return $this->redirect(['search/index', 'query' => 'wawa']);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question