致命错误:在Codeigniter 2和PHP 5.1中找不到类“ DOMDocument”

时间:2019-01-18 06:33:13

标签: php codeigniter-2 dompdf

我在本地主机中使用PHP 5.6,此生成pdf的脚本运行良好。但是在使用PHP 5.1的服务器中,出现了该错误。这是application / libraries / pdf.php中的脚本。

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once (dirname(__FILE__)) . '/dompdf/dompdf_config.inc.php';

class Pdfgenerator {

   function __construct() {
      $this->ci =& get_instance();

      $this->dompdf = new DOMPDF();

   }

   function generate($data){
      $html = $this->ci->load->view($data['template'],$data,true);
      $paper_size = isset($data['paper_size']) ? $data['paper_size'] : 'A4';
      $orientation = isset($data['orientation']) ? $data['orientation'] : 'potrait';
      $this->dompdf->set_paper($paper_size,$orientation);
      $this->dompdf->load_html($html);
      $this->dompdf->render();
      $this->dompdf->stream($data['filename'].'.pdf',array('Attachment'=>0));                
   }
}

要使它在PHP 5.1中工作,我应该进行哪些更改?

0 个答案:

没有答案