我正在 prestashop 1.4 中创建一个模块,比如说blocktest
模块/blocktest/blocktest.php:
...
public function hookLeftColumn($params)
{
global $smarty;
$smarty->assign(array(
'test' => 'test'
));
return $this->display(__FILE__, 'blocktest.tpl');
}
public function hookHeader()
{
Tools::addCSS($this->_path.'blocktest.css', 'all');
}
模块/blocktest/blocktest.css:
* { background-color: red; }
问题:
我的CSS不包括在内。我尝试了什么:
在admin > preferences > performances > smarty
中,我已将缓存设置为no
,并强制编译为yes
. 在admin > preferences > performances > smarty
中,缓存设置为no
。
现有模块使用相同的 css 包含:Tools::addCSS($this->_path.'blocktest.css', 'all');
,但 css 文件位于<themeName>/css/modules/<moduleName>/<moduleName>.css
. 这很奇怪,因为 $this->_path 指向模块文件夹 : modules/<moduleName>/
。
但无论如何,我试图将我的 css 文件放入 中 <themeName>/css/modules/blocktest/blocktest.css
,但这不起作用。也许我错过了什么