|
|
|
สอบถาม เกี่ยว mpdf yii ไม่แสดงข้อมูลออกครับ ออกมาแต่หัวตาราง..ครับ.. |
|
|
|
|
|
|
|
Code (PHP)
public function actionArticlePdf() {
// select all data
$sql = "SELECT * FROM tbl_article ORDER BY ArticleID DESC LIMIT 300 ";
if (!empty($_POST['Search'])) {
$Search = $_POST['Search'];
//select query ByName
$sql = "SELECT * FROM tbl_article
WHERE ArticleName LIKE '%" . $Search . "%'";
}
$SearchList = Yii::app()->db->createcommand($sql)->QueryAll();
$this->renderPartial('ArticlePdf', array(
'sql' => $sql,
'SearchList' => $SearchList,
'Search' => $Search,
));
}
public function actionSearchArticlePdf() {
$mPDF1 = Yii::app()->ePdf->mpdf();
$mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');
$mPDF1 = Yii::app()->ePdf->mpdf('th', 'A4', '0', '');
# render (full page)
$mPDF1->WriteHTML($this->renderPartial('ArticlePdf', array(), true));
//$mPDF1->WriteHTML(CHtml::image(Yii::getPathOfAlias('webroot.css') . '/bg.gif' ));
$mPDF1->Output();
}
ไม่แสดงข้อมูลออกครับ
Tag : PHP, Yii PHP Framework
|
|
|
|
|
|
Date :
2015-10-21 14:49:10 |
By :
โต้ง |
View :
926 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pay attention to WriteHTML() function, you have missing the body part.
|
|
|
|
|
Date :
2020-06-06 18:42:14 |
By :
PhrayaDev |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|