My Controler
function actionLogin()
{
//After success validation
$url = $_POST['returnUrl']; // www.example.com/get_response/
$arr = array('response' => 'Failed', 'msg' => 'login success','tokenKey'=> 'token');
//How to send the response to url
}
In my above code i have to send the $arr array to $url absolute URL.
I found some solutions for this is it works here?
Yii::$app->getResponse()->redirect('http://newdomain.com');
But i don't know how to use in my case or is there any better way
In controller, use:
$this->redirect("absolute URL");
If you want redirect to a specific action:
$this->redirect(array('controller/action'));