server - Class 'mPDF' not found in Yii2 -
i have problem page on server. i'm using yii2 framework , mpdf; configured according instructions: http://www.bsourcecode.com/yiiframework2/create-pdf-files-using-mpdf-in-yiiframework-2-0/
page work on localhost on windows , xampp when try run page on debian 8 have error:
class 'mpdf' not found
configuration: http://www.bsourcecode.com/yiiframework2/create-pdf-files-using-mpdf-in-yiiframework-2-0/
function in php:
public function actioncreatepdf() { $request = yii::$app->request; $generate_table = $request->post(); $mpdf = new mpdf; $mpdf->writehtml($this->renderpartial('view_pdf', ['data'=>$data])); $mpdf->output('data.pdf', 'd'); exit; }
i have no idea i'm doing wrong, it's not running on debian
in case resolved, adding 'mpdf\' => array($vendordir . '/mpdf') autoload_psr4.php required me namespace of class files in ../mpdf/classes using line namespace mpdf; among errors fixed changing include include_once prevent php seeing classes duplicate declaration despite presence of class_exists() test
Comments
Post a Comment