Redirect in controller to external site in new tab

Hi guys, following code will throw out Exception

Array to string conversion

My intention is to load external web site with special parameters in another tab.How should be coded correctly?

$paramValue = "12";

return $this->redirect("$paramValue", ['target' => '_blank']);

All I achieved - without error- is to create link, but this is not the same. So, it’s no alternative!


$paramValue = "12";


return Html::a('ShowFile', $url, ['target' => '_blank', 'title' => 'Show File in another tab', 'data' => ['pjax' => '0']]);

You can not force to open a new tab on serverside when doing a redirect.

It is only possible on client side. Therefor you have to create a link with target: "_blank".

I already wrote that link is not alternative(ready my question carefully,please),'cause link has to be pushed before doing action!

It must be possible loading page in another tab without pushing link before!!!

Maybe, it’s possible doing some JavaScript stuff in Controller?

I tried like this but didn’t succeed. JS-Code won’t be executed in Controller


 $js = <<< JS

var url="";window.location = url;