简体   繁体   中英

How to render a popup in yii controller action?

How to render a popup in YII controller action?

i want to open new window for some actions...please help me with this... (i want this when i call a action not when i click a link)

Ex. when i go to view action in invoice controller it should open in a new window...

is there any way to render a popup...

This is my action which generate pdf using MPDF ... It should open in a new window.

public function actionReport() {
    $date=Yii::app()->Date->onlyNow();
    $name="ITEM Reprt(".$date.")";
    $mPDF1 = Yii::app()->ePdf->mpdf('L', 'A5');
    $mPDF1->WriteHTML($this->renderPartial('test', array(), true));
    $mPDF1->Output($name,'I');

}

THANKS...!

Why popups? Simply create link with target="_blank" , browser will open new window or new tab - per user preferences.

<a href="<?= Yii::app()->createUrl('report', array(/* params */));?>" target="_blank">Print PDF!</a>

You can even embed pdf or use pdfobject etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM