문제

How can i return response object in new window ? I mean, i need to response html page but in the new window like a target blank.

    $response = new Response($html);
    $response->setStatusCode(200); 
    return $response; 

Above code return the html page but in the same tab.

도움이 되었습니까?

해결책

Symfony doesn't handle this. This is handled by client side functionality (target). The best thing to do is to make the trigger for your action open in a new window. So if your trigger is a link, you can do something like:

<a href="{{ path('yourRoute') }}" target="_blank">Open in new window</a> 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top