DOM pdf codeigniter: Class 'DOMPDF' not found error

后端 未结 4 1742
孤独总比滥情好
孤独总比滥情好 2020-12-19 21:09

I trying to add DOM PDF library to my codeigniter application

1.Download dompdf and copy the dompdf folder to libraries folder.

2.Create file

4条回答
  •  长情又很酷
    2020-12-19 21:37

    Starting with v0.7.0 Dompdf uses namespaces. You probably need to add a use statement prior to referencing the class. Or reference it using the full namespace path.

    Try:

    require_once(dirname(__FILE__) . '/dompdf/autoload.inc.php');
    use Dompdf\Dompdf;
    class Pdf extends Dompdf
    {
    ...
    }
    

    Usage is available in the readme or on the wiki usage page.

提交回复
热议问题