I wonder is there any way to make this code more subtle?
Ex
public function hookDisplayHeader()
{
if(Tools::getValue('controller')=='index'){
$this->context->controller->addCSS(($this->_path).'something.css', 'all');
}
if(Tools::getValue('controller')=='cms'){
$this->context->controller->addCSS(($this->_path).'something.css', 'all');
}
if(Tools::getValue('controller')=='product'){
$this->context->controller->addCSS(($this->_path).'something.css', 'all');
}
if(Tools::getValue('controller')=='category'){
$this->context->controller->addCSS(($this->_path).'something.css', 'all');
}
}
to simple
public function hookDisplayHeader()
{
if(Tools::getValue('controller')=='index AND product AND cms AND category'){
$this->context->controller->addCSS(($this->_path).'something.css', 'all');
}
}
this code not work :(