title: Yii2 - Redirecting to external url opening in new browser tab within a controller
body: <p>Following code will throw out Exception</p>
  <blockquote>
  <p>Array to string conversion</p>
  </blockquote>
  <p>My intention is to load <strong>external website</strong> with special parameters in another tab. How should be coded correctly? Please notice, that redirect shouldn't render internal Controller method!!</p>
  <pre><code>$paramValue = &quot;12&quot;;
  return $this-&gt;redirect(&quot;http://example.com?param=$paramValue&quot;, ['target' =&gt; '_blank']);
  </code></pre>
  <p>All I achieved - without error- is to create link, but this is not the same. So, it's no alternative!</p>
  <pre><code>&lt;center&gt;
  &lt;?php echo Html::a(
      'StepStone laden',
      $url,
      [
          'class' =&gt; 'btn btn-success 
       btn-block',
          'target' =&gt; '_blank',
          'title' =&gt; 'Load StepStone',
          'data' =&gt; ['pjax' =&gt; '0']
      ]
  );
  ?&gt;
  &lt;/center&gt;
  </code></pre>
  <h3>Edit(for Muhammad):</h3>
  <p>This is my solution, as it is existing actually:</p>
  <pre><code>/* It's not possible to render external URL in aonther tab using php. So, following order will render external URL in same tab:
      return $this-&gt;redirect($url); */
    
  private function RenderBoerse($name, $DynamicModel) {
      $ReplaceJob = $DynamicModel-&gt;job;
      $ReplaceTown = $DynamicModel-&gt;place;
      $Jobboerse = LJobboersen::findOne(['name' =&gt; $name])-&gt;ergebnis_seite;
      $url = $this-&gt;WebStringErsetzen($Jobboerse, &quot;###&quot;, $ReplaceJob);
      $url = $this-&gt;WebStringErsetzen($url, &quot;&amp;&amp;&amp;&quot;, $ReplaceTown);
      ?&gt;
      &lt;center&gt;
          &lt;?= Html::a(&quot;$name laden&quot;, $url, ['class' =&gt; 'btn btn-success btn-block', 'target' =&gt; '_blank', 'title' =&gt; &quot;Load $name&quot;]);
          ?&gt;&lt;/center&gt;&lt;?php
  }
  
   private function WebStringErsetzen($str, $suchen, $ersetzen) {
      $string = str_replace($suchen, $ersetzen, $str);
      return $string;
  } 
  
      
        
  </code></pre>