제 프로젝트에 타사 클래스 (mPDF)를 추가하려고합니다. 내가 뭘 잘못하고 있니? 나는 app/Vendor/mPDF
디렉토리에 모든 파일을 넣어 그내 cakephp 프로젝트에 제 3 자 클래스를로드하는 방법?
App::import('Vendor', 'mPDF', array('file' => 'mPDF'.DS.'mpdf.php'));
$this->mpdf = new $this->mPDF1();
$html = '<font> TEST</font>';
$this->mpdf->WriteHTML($html);
$this->mpdf->Output();
편집합니다 지금 코드는 다음과 같이보고한다 :
public function grafikRehabilitant(){
$this->autoRender=false;
$this->layout='pusty';
App::import('Vendor', 'mPDF', array('file' => 'mPDF'.DS.'mpdf.php'));
$mpdf = new mPDF();
$html = '<font> TEST</font>';
$mpdf->WriteHTML($html);
$mpdf->Output();
}
을 그리고 여기에 오류가 :
Notice (8): Undefined index: BODY [APP\Vendor\mPDF\classes\cssmgr.php, line 966]
Notice (8): Undefined index: BODY>>ID>> [APP\Vendor\mPDF\classes\cssmgr.php, line 1011]
Notice (8): Undefined offset: -1 [APP\Vendor\mPDF\classes\cssmgr.php, line 1150]
Notice (8): Undefined index: outline-s [APP\Vendor\mPDF\mpdf.php, line 3892]
Notice (8): Undefined property: mPDF::$hasOC [APP\Vendor\mPDF\mpdf.php, line 27505]
Notice (8): Undefined property: mPDF::$hasOC [APP\Vendor\mPDF\mpdf.php, line 27608]
Notice (8): Undefined property: mPDF::$hasOC [APP\Vendor\mPDF\mpdf.php, line 9158]
Warning (2): Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\lib\Cake\Utility\Debugger.php:801) [APP\Vendor\mPDF\mpdf.php, line 7447]
Warning (2): Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\lib\Cake\Utility\Debugger.php:801) [APP\Vendor\mPDF\mpdf.php, line 1736]
mPDF error: Some data has already been output to browser, can't send PDF file
FULL WORKING 코드
$this->autoRender=false;
$this->layout='pusty';
error_reporting(0);
App::import('Vendor', 'mPDF', array('file' => 'mPDF'.DS.'mpdf.php'));
$mpdf = new mPDF();
$html = '<font> TEST</font>';
$mpdf->WriteHTML($html);
$mpdf->Output();
어떤 오류가 발생합니까? –
이 링크를 참조하십시오 ... http : //bakery.cakephp.org/articles/segy/2012/01/19/mpdf_component_for_generating_pdf_files_from_html ... 데모 코드 링크도 제공됩니다 .. –
두 번 확인하십시오. 예배 규칙서. 'vendors '와'app/vendor'가 있습니다. 답변에서 언급 한 경로는이 둘 중 어느 것과도 일치하지 않습니다. 아니면 그냥 오타입니까? –