render view in new tab yii 1.1

95 Views Asked by At

I am trying to render view in new tab
this is what I have tried

$this->render('receipt', array(
            'data' => $data
        ));

But I want to open this receipt view in new tab. Please some one help me

1

There are 1 best solutions below

0
Piemol On

If you mean a new browser tab, this question is not about yii at all. It's a html question. If you mean something different, update your question.
You can open a new browser tab to your receipt controller/action with a anchor tag on your page and use the target attribute, for example: <a href="/order/receipt" target="_blank">View receipt</a>. Then a new browser tab wil open and yii will route order/receipt the url to your controller and view that renders it.
Also see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target