HTML模板PHP get Header()-如何访问其内容?

HTML模板PHP get Header()-如何访问其内容?,php,prestashop,smarty,Php,Prestashop,Smarty,我是PHP新手,我正在尝试修改由prestashop模块创建的pdf的标题。 我想删除标志图像“spo devis” 我搜索了很长时间,终于找到了页眉所在的页面。 不幸的是,我不明白它是如何工作的 这是班级结构 类HTMLTemplateQuotationPdf扩展HTMLTemplate { 公共购物车; 公开报价:$quote; 公共环境; 私人股本为1.5亿美元; 公共函数构造($QUOTE$smarty) { ... } 公共函数getContent() { ... } 公共函数getH

我是PHP新手,我正在尝试修改由prestashop模块创建的pdf的标题。 我想删除标志图像“spo devis”

我搜索了很长时间,终于找到了页眉所在的页面。 不幸的是,我不明白它是如何工作的

这是班级结构

类HTMLTemplateQuotationPdf扩展HTMLTemplate
{
公共购物车;
公开报价:$quote;
公共环境;
私人股本为1.5亿美元;
公共函数构造($QUOTE$smarty)
{ ... }
公共函数getContent()
{ ... }
公共函数getHeader()
{ ... }
公共函数getFooter()
{ ... }
公共函数getFilename()
{ ... }
公共函数getBulkFilename()
{ ... }
受保护的函数opartDevisionGetTemplate($template\u name)
{ ... }
}
对于页脚来说,tpl存在很简单,代码调用它

公共函数getFooter()
{
$shop_address=$this->getShopAddress();
$this->smarty->assign(数组)(
“在您的账户中可用”=>$this->available\u在您的账户中可用,
“店铺地址”=>$shop\u地址,
'shop\u fax'=>Configuration::get('PS\u shop\u fax',null,null,(int)$this->cart->id\u shop),
'shop\u phone'=>Configuration::get('PS\u shop\u phone',null,null,(int)$this->cart->id\u shop),
'shop\u details'=>Configuration::get('PS\u shop\u details',null,null,(int)$this->cart->id\u shop),
'free_text'=>Configuration::get('PS_INVOICE_free_text',(int)Context::getContext()->语言->id,null,(int)$this->cart->id_shop)
));
返回$this->smarty->fetch($this->opartdesigngetTemplate('footer'));
}
受保护的函数opartDevisionGetTemplate($template\u name)
{
$template=false;
$default_template=rtrim($PS_MODULE_DIR_,DIRECTORY_SEPARATOR)。DIRECTORY_SEPARATOR.'opartdesign/views/templates/front/pdf'。DIRECTORY_SEPARATOR.$template_name.'.tpl';
如果($this->isSeven){
$overrided_template=\u PS_ALL_THEMES_DIR.$this->shop->theme->getName().DIRECTORY_SEPARATOR.'modules/opartdesign/views/templates/front/pdf'。DIRECTORY_SEPARATOR.$template_name..tpl';
}否则{
$overrided_template=_PS_ALL_THEMES_DIR.$this->shop->getTheme().DIRECTORY_SEPARATOR.'modules/opartdesign/views/templates/front/pdf'.DIRECTORY_SEPARATOR.$template_name..tpl';
}
如果(文件_存在($overrided_template)){
$template=$overrided\u模板;
}elseif(文件存在($default\u模板)){
$template=$default\u模板;
}
返回$template;
}
但对于头球,我迷路了

公共函数getHeader()
{
$this->assignCommonHeaderData();
$this->smarty->assign(数组)(
'header'=>$this->module->l('quote','htmltemplatequotationpdf'),
'title'=>'#'。$this->quote->id,
'date'=>Tools::displayDate($this->cart->date\u upd),
));
返回$this->smarty->fetch($this->getTemplate('header'));
}
我的印象是它自称(htmltemplatequotationpdf)

我没有找到标题模板(tpl),我问自己它是否真的存在。 我搜索了所有的img标签、src标签、“header”单词和“pdf”单词

这就像头部有一个不同于经典模板的形状

你能帮我吗


提前感谢

您正在寻找的方法位于classes/pdf/HTMLTemplate.php中,它是assignCommonHeaderData

您要指出的是一个模块调用

你可以找到

$this->smarty->assign([
            'logo_path' => Tools::getShopProtocol() . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_ . $logo,
            'img_ps_dir' => Tools::getShopProtocol() . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_,
            'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'),
            'date' => $this->date,
            'title' => $this->title,
            'shop_name' => $shop_name,
            'shop_details' => Configuration::get('PS_SHOP_DETAILS', null, null, (int) $id_shop),
            'width_logo' => $width,
            'height_logo' => $height,
        ]);
这是来自PS1.7.7.0的,但您需要的一切都在那里

顺便说一下,对tpl文件进行检查,以确保不再引用将不再传递的变量