in a custom module, I created a custom form. On this form, I have an ajax button to open a specific file (.pdf).
Here is my code in a custom submit function :
$url = 'myfileUrl'; $response = new AjaxResponse(); $command = new RedirectCommand($url); $response->addCommand($command);
It's ok and the file is opened when I click on the button. But, the page is closed to open the file. How can I specify an attribute "target" to open the file in a new window? If not possible, is there another ajax command to open an external URL?