简体   繁体   English

PHP致命错误– yii \\ base \\ ErrorException类'Dompdf \\ FrameDecorator \\ Page'未找到

[英]PHP Fatal Error – yii\base\ErrorException Class 'Dompdf\FrameDecorator\Page' not found

I am trying to us Dompdf in my yii2 application, but it's showing me an error message. 我正在yii2应用程序中尝试向我们发送Dompdf,但它向我显示错误消息。

PHP Fatal Error – yii\\base\\ErrorException Class PHP致命错误– yii \\ base \\ ErrorException类
'Dompdf\\FrameDecorator\\Page' not found 找不到'Dompdf \\ FrameDecorator \\ Page'

and I don't understand reason of that. 我不明白原因。

You should run this command to add this extension into your composer.json. 您应该运行此命令将此扩展名添加到composer.json中。

composer require dompdf/dompdf

OR add this line in your composer.json require section and run composer update : 或者在您的composer.json require部分添加此行,然后运行composer update

"require": {
    "dompdf/dompdf": "^0.7.0"
},

And then in your view access this way. 然后您认为以这种方式访问​​。

// reference the Dompdf namespace
use Dompdf\Dompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到消息“类'模型名称'的PHP致命错误'yii \\ base \\ ErrorException' - PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'Model Name' not found DOMPDF错误:Dompdf \\ FrameDecorator \\ AbstractFrameDecorator类未获得资金 - DOMPDF error: Class Dompdf\FrameDecorator\AbstractFrameDecorator not fund PHP致命错误– yii \\ base \\ ErrorException调用YII2中未定义的方法Yii :: app() - PHP Fatal Error – yii\base\ErrorException Call to undefined method Yii::app() in YII2 PHP致命错误– yii \\ base \\ ErrorException访问未声明的静态属性:yii \\ filters \\ HttpCache :: $ cacheControlHeader - PHP Fatal Error – yii\base\ErrorException Access to undeclared static property: yii\filters\HttpCache::$cacheControlHeader PHP 致命错误:Class 在第 30 行找不到“DOMPDF” - PHP Fatal error : Class 'DOMPDF' not found on line 30 YII PHP致命错误:找不到类“ CWebApplication” - YII PHP Fatal error: Class 'CWebApplication' not found ErrorException [致命错误]:找不到类“验证” - ErrorException [ Fatal Error ]: Class 'Validate' not found yii \\ base \\ ErrorException - 找不到类'app \\ controllers \\ EntryForm' - yii\base\ErrorException - Class 'app\controllers\EntryForm' not found PHP公告– yii \\ base \\ ErrorException - PHP Notice – yii\base\ErrorException ErrorException [致命错误]:找不到类“控制器”-Kohana 3.0.3错误 - ErrorException [ Fatal Error ]: Class 'Controller' not found - Kohana 3.0.3 Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM