H
H
hollanditkzn2017-03-15 13:38:29
Yii
hollanditkzn, 2017-03-15 13:38:29

How to correctly redirect users to another controller?

I did something like this in the controller, but

return $this->redirect('http://crm/frontend/web/index.php?r=zakaz%2Findex');

Now my controller is crm/frontend/web/index.php?r=site%2Flogin

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Bukharev, 2017-03-15
@hollanditkzn

return $this->redirect(['/controller/action','id'=>'xxx']);

rmcreative.ru/blog/post/yii2-izmenenija-v-workote-s-url

D
Dmitry, 2017-03-15
@slo_nik

Good afternoon.

return $this->redirect('controller/action')
// or
return $this->redirect('/controller/action')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question