DOMPDF loadView() error - undefined variable: data
问题 I'm currently trying to incorporate the DOMPDF Wrapper for Laravel into my project, however I'm having troble figuring out how to pass a variable into the PDF template. As per the instructions, in my controller I have: //PrintController.php $data = array('name'=>'John Smith', 'date'=>'1/29/15'); $pdf = PDF::loadView('contract', $data); return $pdf->stream('temp.pdf'); and in my view: //contract.php ... <p><?php echo $data->name ?><p> <p>Signature</p> But when I try to render the page, I get