我正在尝试创建一个PrestaShop模块以读取PDF文件并显示它们。
Hello World
模块并将其钩住HTMLTemplateCustomPdf extends from HTMLTemplate
我不确定下一步将是什么?我应该在custom_template_content.tpl
文件中放什么?
这是我的HTMLTemplateCustomPdf类的内容
<?php
class HTMLTemplateCustomPdf extends HTMLTemplate
{
public $custom_model;
public function __construct($custom_object, $smarty)
{
$this->custom_model = $custom_object;
$this->smarty = $smarty;
// header informations
$id_lang = Context::getContext()->language->id;
$this->title = HTMLTemplateCustomPdf::l('Custom Title');
// footer informations
$this->shop = new Shop(Context::getContext()->shop->id);
}
public function getContent()
{
$this->smarty->assign(array(
'custom_model' => $this->custom_model,
));
return $this->smarty->fetch(_PS_MODULE_DIR_ . 'my_module/custom_template_content.tpl');
}
public function getFilename()
{
return 'custom_pdf.pdf';
}
public function getBulkFilename()
{
return 'custom_pdf.pdf';
}
}