Home yii redirect with array
Reply: 2

yii redirect with array

Jigar7521
1#
Jigar7521 Published in 2017-12-05 11:01:54Z
$this->redirect(array($redirect, 'error' => $error, 'msg' => $msg, 'details' => $details));

How can we pass array as a parameter? I have tried during redirection.

Returning:

Error 400 Your request is invalid.

Any help would be appreciated.

Trainee
2#
Trainee Reply to 2017-12-06 04:00:28Z

If redirect to different page

$this->redirect(array('YourController/YourFunction','error'=>$error,'msg'=>$msg,'details'=>$details));

If in the same controller you just need to put your function on the array. hope this can help

Jigar7521
3#
Jigar7521 Reply to 2017-12-06 05:36:12Z

After a lots of tries I have found that , the array what I was passing is an associative array and passing with GET method, so while redirection if we seen in URL, associative array passing with every internal element of $details array, and same parameters are not listed at destination method, so the result will not found such a method.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.390039 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO