PHP Fatal Error – yii\base\ErrorException

Hi everyone,

have a problem on this trying to generate a pdf file from my generated CRUD

here’s my code

.../.../site/transaction/index

<?php

use yii\helpers\Html;

use yii\grid\GridView;

use backend\controllers\UserController;

/* @var $this yii\web\View */

/* @var $searchModel app\models\ItemsSearch */

/* @var $dataProvider yii\data\ActiveDataProvider */

$mpdf = new mPDF;//or $pdf = new Pdf…

$mpdf->content = $this->render(‘index’, [‘searchModel’=>$searchModel, ‘dataProvider’=>$dataProvider]);

return $mpdf->render();

exit;

$this->title = ‘Transactions’;

$this->params[‘breadcrumbs’][] = $this->title;

?>

the result is PHP Fatal Error – yii\base\ErrorException

Maximum function nesting level of ‘100’ reached, aborting!

help me thanks yii




$mpdf = new mPDF;//or $pdf = new Pdf...

$mpdf->content = $this->render('index', ['searchModel'=>$searchModel, 'dataProvider'=>$dataProvider]);

return $mpdf->render();



This code need to be in your action like I said you…

Nice code! :D

Your index is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is rendering index which is…

@Timmy78 - thanks a lot now its working…

@jacmoe - thanks for motivating me :)

More power Yii