FPDF/FPDI Error: Fatal error: Class 'setasign\\Fpdi\\FpdfTpl' not found in

半城伤御伤魂 提交于 2019-12-04 21:43:42

Require the classes this way:

require_once('fpdf/fpdf.php');
require_once('fpdi/src/autoload.php');

Then add use \setasign\Fpdi\Fpdi; to your watermark and not only use \setasign\Fpdi; or use the correct class name (including the full namespace) in your class declaration.

What happens if you change this:

require_once('fpdf/fpdf.php');
require_once 'fpdi/src/fpdi.php';
require_once('fpdi/src/FpdfTpl.php');

To this?

require_once('fpdf/fpdf.php');
require_once('fpdi/src/autoload.php');

Or if you don't have autoload then you maybe need to add:

require_once('fpdi/src/FpdiTrait.php');
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!