我正在使用cakePHP 2.6
和CakePdf
插件。在生成和保存时,我遇到了Missing View
代码控制器
public function testpdf() {
$CakePdf = new CakePdf();
$CakePdf->template('newsletter', 'default');
// write it to file directly
$pdf = $CakePdf->write(APP . 'files' . DS . 'newsletter.pdf');
}
错误已恢复:
Missing View
Error: The view for AdminsController::testpdf() was not found.
Confirm you have created the file: Pdf/newsletter.ctp in one of the following paths:
/var/www/html/cake2pluginsEdited/app/View/Plugin/AdminUsers/Pdf/newsletter.ctp
/var/www/html/cake2pluginsEdited/app/Plugin/AdminUsers/View/Pdf/newsletter.ctp
/var/www/html/cake2pluginsEdited/app/View/Pdf/newsletter.ctp
我在上面的错误中的所有给定路径上创建了newsletter.ctp
,它仍然为我提供了相同的错误。已经获得write
整个app
文件夹的权限。还经历了Git Hub
Issues CAkePdf上的问题无法找到解决方案,任何指针都会有很大的帮助。
代码Render as PDF
工作正常,但无法将其保存在服务器上。