Prestashop とプログラミングは初めてで、Prestashop 1.4.5 にコンテンツを追加しようとしています。
hookHeader にフックする新しい単純なモジュールを作成しました。動作するようになり、ショップの上部に Hello World が表示されます。しかし、サイトを開いてソースコードを開くと、doctype の前に追加されていることがわかります。
こんにちは世界
私のモジュールphpは次のようになります-私はテンプレートを使用していません:
if ( !defined( '_CAN_LOAD_FILES_' ) ) 終了;
class primanetkintop extends Module {
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 に表示されないのはなぜですか? 私は何を間違っていますか?
ありがとう:D