My code html like this :
Update Regarding changes with version of dompdf >= 0.7.0
Because the dompdf_config.inc.php file has been removed from this release (and is no longer referenced) all dompdf options should be set at run time.
The FontMetrics class is now instantiated instead of static. To simplify migration of embedded scripts from earlier versions of dompdf we provide access to the instantiated
FontMetrics
class via the$fontMetrics
variable. Please update your embedded scripts. For example,FontMetrics::get_font('helvetica')
would now be$fontMetrics->getFont('helvetica')
.~ Thanks to Dennis Ameling's answer for the updated information.
by looking over the dompdf_config.inc.php
file. As it turns out, DOMPDF_ENABLE_PHP
is set to false
thus causing the inline php script to be ignored. I simply edited dompdf_config.custom.inc.php
to the following and all is fine and working with the later code in the view
.
In dompdf/dompdf_config.custom.inc.php
At Run Time
$dompdf->set_option("isPhpEnabled", true);
Then, in my html file
If you go this route, don't forget to restart Apache
讨论(0)