[英]How to render a popup in yii controller action?
How to render a popup in YII controller action? 如何在YII控制器动作中呈现弹出窗口?
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. 这是我使用
MPDF
生成pdf的操作。它应该在新窗口中打开。
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. 只需使用
target="_blank"
创建链接,浏览器将根据用户首选项打开新窗口或新选项卡。
<a href="<?= Yii::app()->createUrl('report', array(/* params */));?>" target="_blank">Print PDF!</a>
You can even embed pdf or use pdfobject etc. 您甚至可以嵌入pdf或使用pdfobject等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.