错误是,我不能使用循环前端或此包mikehaertl/phpwkhtmltopdf生成PDF。
$pdf->addPage(
'<html>
<HEAD>
<TITLE>Acta de Recepcion</TITLE>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
</HEAD>
<body>
<?php
@foreach ($due as $d)
{{$d->placa}}
@endforeach
?>
</body>
</html>');我需要使用foreach动态添加日期。
发布于 2019-01-25 18:00:49
你为什么不试试另一种方法:
// build the content
$content = '<html>
<HEAD>
<TITLE>Acta de Recepcion</TITLE>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
</HEAD>
<body>';
// add the dates
foreach ($due as $d) {
$content .= $d->placa;
}
// complete the content
$content .= '</body>
</html>';
// add the page
$pdf->addPage($content);https://stackoverflow.com/questions/54370528
复制相似问题