include(HTML2PDF_locale.php):无法在YII中打开流

时间:2016-07-22 03:22:38

标签: yii-extensions

尝试在YII中使用html to pdf扩展名。将所有必需的文件放在其位置并在config中包含以下代码:

 'ePdf' => array(
    'class'         => 'ext.yii-pdf.EYiiPdf',
    'params'        => array(
        'mpdf'     => array(
            'librarySourcePath' => 'application.vendor.mpdf.*',
            'constants'         => array(
                '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.runtime'),
            ),
            'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
            /*'defaultParams'     => array( // More info: http://mpdf1.com/manual/index.php?tid=184
                'mode'              => '', //  This parameter specifies the mode of the new document.
                'format'            => 'A4', // format A4, A5, ...
                'default_font_size' => 0, // Sets the default document font size in points (pt)
                'default_font'      => '', // Sets the default font-family for the new document.
                'mgl'               => 15, // margin_left. Sets the page margins for the new document.
                'mgr'               => 15, // margin_right
                'mgt'               => 16, // margin_top
                'mgb'               => 16, // margin_bottom
                'mgh'               => 9, // margin_header
                'mgf'               => 9, // margin_footer
                'orientation'       => 'P', // landscape or portrait orientation
            )*/
        ),
        'HTML2PDF' => array(
            'librarySourcePath' => 'application.vendor.html2pdf.*',
            'classFile'         => 'html2pdf.class.php', // For adding to Yii::$classMap
            /*'defaultParams'     => array( // More info: http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:accueil
                'orientation' => 'P', // landscape or portrait orientation
                'format'      => 'A4', // format A4, A5, ...
                'language'    => 'en', // language: fr, en, it ...
                'unicode'     => true, // TRUE means clustering the input text IS unicode (default = true)
                'encoding'    => 'UTF-8', // charset encoding; Default is UTF-8
                'marges'      => array(5, 5, 5, 8), // margins by default, in order (left, top, right, bottom)
            )*/
        )
    ),
    ),

我收到以下错误

  

错误:include(HTML2PDF_locale.php):无法打开流:没有这样的   文件或目录

1 个答案:

答案 0 :(得分:0)

它可能是命名空间问题,添加命名空间app / ext。