我正在使用以下代码制作和下载pdf文件。
MyController.php
$pdfTemplate = View::make('sample', $data)->render();
$pdf = App::make('dompdf');
$pdf->loadHTML($pdfTemplate);
return $pdf->download('sample_file.pdf');
sample.php
<html>
<head>
</head>
<body>
here by using php i need to display div based on page number
<div>This is in page 1</div>
<div>This is in page 2</div>
</body>
</html>
有什么建议吗?