【问题标题】:Use html2pdf from $this->renderpartial in Yii在 Yii 中使用 $this->renderpartial 中的 html2pdf
【发布时间】:2013-12-09 07:21:59
【问题描述】:

我可以这样做吗:

$content = $this->renderpartial('DeedCertificate',array('deed'=>$deed,'cnt'=>$cnt));        
$html2pdf = new HTML2PDF('P','A4','en');
$html2pdf->WriteHTML($content);
$html2pdf->Output('/var/www/myapp/images/example.pdf','F');

$html2pdf->使用 $content = "hello"l 时的输出就像一个魅力。 现在我正在尝试传递 yii 的 renderpartial 的输出 .. 所以它可以变成 pdf .. 但我的 pdf 是空白的。

【问题讨论】:

    标签: php yii renderpartial html2pdf


    【解决方案1】:

    你可以为你制作renderPartial to returnhtml generated,像这样:

     $this->renderPartial('DeedCertificate' , array('data'=>$data) , true); // set this to true
    

    【讨论】:

    • 我不知道,我想你可以自己检查一下:D
    • 当然,我很抱歉!!我应该自己检查一下。感谢您的快速回复!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-14
    • 1970-01-01
    • 2014-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-21
    相关资源
    最近更新 更多