我想在prestashop admin中使用backOfficeHeader
鉤子添加JavaScript文件,但沒有任何事情發生。我的代碼如下。addJS函數不適用於prestashop中的admin
public function install()
{
if (!parent::install()
|| !$this->registerHook('backOfficeHeader'))
return false;
return parent::install() &&
$this->registerHook('backOfficeHeader');
}
public function hookBackOfficeHeader() {
$this->context->controller->addJS(_MODULE_DIR_.$this->module->name.'js/hs_custom.js');
}