【发布时间】:2015-06-21 07:21:34
【问题描述】:
我正在使用DOMPDF version (0.6 beta)。我收到以下错误:
Fatal error: Call to a member function append_child() on null in C:\xampp\htdocs\practice\application\helpers\dompdf\include\frame_tree.cls.php on line 220
这是我的代码 sn-p:
$this->load->helper(array('dompdf', 'file'));
$quoteId = $this->uri->segment('4');
$filename ='ship-'.uniqid().'.pdf';
$data = pdf_create($html, '', false);
$html = file_get_contents(BASE_URL.'index.php/admin/quotes/createQuotePDF/'.$quoteId);
在过去的 4 个小时里,我一直被这个错误困扰。 也无法从 Google 获得太多帮助。我们将不胜感激
【问题讨论】:
-
在您的代码 sn-p 中,变量
$html的声明位于函数调用pdf_create之后。声明必须在函数调用之前完成,否则变量将保持未定义并导致错误。
标签: javascript php jquery pdf dompdf