Monday, 15 February 2010

php - Using DOMpdf within silex -



php - Using DOMpdf within silex -

because dompdf doesn't have serviceprovider i'm little confused on how access it. in regular project can utilize code:

// composer's auto-loading functionality require "vendor/autoload.php"; // inhibit dompdf's auto-loader define('dompdf_enable_autoload', false); //include dompdf config file (required) require 'vendor/dompdf/dompdf/dompdf_config.inc.php';

i have installed dompdf via composer. i'm trying access in controller:

public function overview(application $app) { $html = "hello world!"; $dompdf = new \dompdf(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("sample.pdf"); }

this gives me error

call undefined method namespace\provider\controller\dompdf::load_html()

so question is, have utilize

require 'vendor/dompdf/dompdf/dompdf_config.inc.php';

in order work? or have access dompdf in silex way?

thanks in advance! :)

kevin

php pdf dompdf silex

No comments:

Post a Comment