我是 Prestashop 和编程的新手,我正在尝试向 Prestashop 1.4.5 添加一些内容。
我制作了一个新的简单模块,它与 hookHeader 挂钩。我让它工作了,它在商店的顶部显示了 Hello World。但是当我打开站点并打开源代码时,我看到它被添加到 doctype 之前:
你好世界
我的模块 php 看起来像这样 - 我没有使用模板:
if ( !defined( '_CAN_LOAD_FILES_' ) ) 退出;
类primanetskintop扩展模块{
function __construct()
{
$this->name = "skintop";
$this->tab = 'front_office_features';
$this->version = '0.1.0';
parent::__construct();
$this->displayName = $this->l('Insert skin top');
$this->description = $this->l('Skin - ikke slettes');
}
function install()
{
if (!parent::install() OR !$this->registerHook('header'))
return false;
return true;
}
function uninstal()
{
if (!parent::uninstall())
return false;
return true;
}
public function hookHeader($params)
{
echo "Hello World!";
}
为什么hello world不显示hookHeader所在的位置?我究竟做错了什么?
谢谢 :D