I am trying to register header hook to display my text:
//install function
return parent::install() &&
$this->registerHook('header');
public function hookHeader()
{
$this->context->controller->addJS($this->_path.'/views/js/front.js');
$this->context->controller->addCSS($this->_path.'/views/css/front.css');
}
what that I get when trying to transparent:
I think you should use : actionFrontControllerSetMedia
/ actionAdminControllerSetMedia
to register yours js and css.
public function install()
{
return parent::install() &&
$this->registerHook('actionAdminControllerSetMedia');
}
public function hookActionAdminControllerSetMedia()
{
$this->context->controller->addJS($this->_path.'/views/js/front.js');
$this->context->controller->addCSS($this->_path.'/views/css/front.css');
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.