php - Class 'DOMPDF' not found after downloading via Composer -
i used composer download latest (v0.7). copied entire downloaded 'vendor' directory web server, error: class dompdf not found
if change use namespaces error 'fatal error call undefined function dompdf()'
several hours trying desperately find missing. never had problems using composer before, (it takes care of dependencies), not in case! ideas appreciated.
sample code: <?php require "../vendor/autoload.php"; $dompdf =\dompdf(); // used new dompdf(); $dompdf->loadhtml($html); $dompdf->render(); $dompdf->stream("sample.pdf", array("attachment"=>0)); ?>
solved myself.. in case interested example given on github page missing critical line
i added: use dompdf\dompdf; , fixed it.
require "../vendor/autoload.php"; use dompdf\dompdf; $dompdf =\dompdf(); // used new dompdf(); $dompdf->loadhtml($html); $dompdf->render(); $dompdf->stream("sample.pdf", array("attachment"=>0));
Comments
Post a Comment