0
yii2 Mpdf로 일부 보고서를 만들고 싶지만 프로그램을 실행할 때 정의되지 않은 함수를 호출하는 것과 같은 오류가 발생했습니다. Mpdf \ mb_regex_encoding()이 프로그램을 해결하는 방법을 알려주세요.정의되지 않은 함수 호출 Mpdf mb_regex_encoding()
이 당신은 mbstring
PHP 확장이 명시 적으로 일부 환경에서 활성화 될 필요가 mbregex
옵션을 포함하여, 사용할 수 있어야 내 컨트롤러
public function actionRpt($id)
{
$content = $this->renderPartial('rpt', [
'model' => $this->findModel($id),
]);
// setup kartik\mpdf\Pdf component
$pdf = new Pdf([
// set to use core fonts only
'mode' => Pdf::MODE_UTF8,
// A4 paper format
'format' => Pdf::FORMAT_A4,
// portrait orientation
'orientation' => Pdf::ORIENT_PORTRAIT,
// stream to browser inline
'destination' => Pdf::DEST_BROWSER,
// your html content input
'content' => $content,
// format content from your own css file if needed or use the
// enhanced bootstrap css built by Krajee for mPDF formatting
'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',
// any css to be embedded if required
'cssInline' => '.kv-heading-1{font-size:18px}',
// set mPDF properties on the fly
'options' => ['title' => 'RPT NCR'],
// call mPDF methods on the fly
'methods' => [
'SetHeader'=>['NCR'],
'SetFooter'=>['{PAGENO}'],
]
]);
}