Newbie here and trying to generate pdf in advanced.
Help me to generate tables generated by CRUD into pdf file.
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'columns' => [
// ['class' => 'yii\grid\SerialColumn'],
//['class' => 'yii\grid\ActionColumn'],
Searching a lot of extension and tutorial<br />
and saw this extension kartik-v/yii2-mpdf (demos.krajee.com/mpdf)
trying to work on it but still no luck …
In your action index :
public function actionIndex()
$pdf = Yii::$app->pdf;//or $pdf = new Pdf...
$pdf->content = $this->render('index', ['searchModel'=>searchModel, 'dataProvider'=>$dataProvider]);
Hi thanks a lot but got this error after wards
Maximum function nesting level of ‘100’ reached, aborting!
i am using mpdf in yii2.
i had setted all the parameters in autoload_namespaces.php.
i used it also in controller. In controller also found that class and showing method list also
but while in browser showing error
exception ‘yii\base\ErrorException’ with message ‘Class ‘mPDF’ not found’ in /var/www/mysite.in/demo/controllers/StudController.php:198
#0 [internal function]: yii\base\Application->handleFatalError()
$mpdf = new mPDF();
how to short out it ?
Check the namespace of mpdf has included in your controller.