Majdi Taleb Majdi Taleb - 1 month ago 23
Twig Question

Symfony2 redirect to an externel url in new tab

I have a function that redirect to an external URL with parametre, but I want to redirect it to a new tab ,
This my code

public function urlAction(){

$directory= $user->getDirectory();
return $this->redirect('http://localhost/sound/index.html?directory='.$directory );

}


I want to open the link in new tab. any suggestion please?

Answer

The only answer possible here is that you can't redirect in a new tab.

You can provide links that open in a new tab or window using the target in html or a function in php, but you can't have a redirect.

Comments