我想将我的html页面生成为pdf,一切正常运行,但是我的复选框未呈现。在这种情况下,我将dompdf用于pdf生成器。
我的观点
<form>
<?php if ($c->jalur == "Prestasi") { ?>
<input style="margin-left: 0px" type="checkbox" checked>Prestasi
<input style="margin-left: 0px" type="checkbox" disabled>Reguler
<?php }else { ?>
<input style="margin-left: 0px" type="checkbox" disabled>Prestasi
<input style="margin-left: 0px" type="checkbox" checked>Reguler
<?php } ?>
</form>
我的CSS
input[type=checkbox]{
display: inline;
white-space: nowrap;
}
input[type=checkbox]:before{
font-family: DejaVu Sans;
}
我的控制器
public function index()
{
$id = '';
$data['calon_mahasiswa'] = $this->M_User->getAllDataUser()->result();
$cond1 = array('id' => $id);
$cek = $this->M_User->getDataCond($cond1,'calon_mahasiswa')->result();
$cond = array('id' => $this->session->userdata('id'));
$data['calon_mahasiswa'] = $this->M_User->getDataUSer($cond,'calon_mahasiswa')->result();
$pdf = new Dompdf\Dompdf();
$html = $this->load->view('card', $data, true);
$pdf->loadHtml($html);
$pdf->set_option('isRemoteEnabled', true);
$pdf->set_option('isHtml5ParserEnabled', true);
$pdf->setPaper('A4', 'potrait');
$pdf->render();
$pdf->output();
$pdf->stream('kartu_pendaftaran');
exit();
}
我希望这样的输出:
[ ]Prestasi [ ]Reguler
但是输出是这样的:
Prestasi Reguler