Prestashop 1.6中的替代控制器 [英] Override controller in Prestashop 1.6

查看:46
本文介绍了Prestashop 1.6中的替代控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的替代无效

我试图将custom.css添加为默认引导主题的安全方法.我遵循了本教程:

I tried to add a custom.css the safe way to our default bootstrap theme. I followed this tutorial:

http://www.prestadb.com/prestashop-override-controllers-tutorial/

与1.6的区别在于文件应放置在以下位置:

The difference to 1.6 should be that the file should be placed in:

/override/controllers/front

/override/controllers/front

代替

/overrides/controllers/

/overrides/controllers/

在第一个提到的目录中,我有一个名为FrontControllerCore.php的文件,其内容如下:

In the first mentioned directory I have a file called FrontControllerCore.php with following content:

<?php
class FrontController extends FrontControllerCore
{
    public function setMedia()
    {
        parent::setMedia();   
        $this->addCSS(_THEME_CSS_DIR_.'custom.css');  
    }
}

?>

但是custom.css没有加载,我在前端的源代码中看不到它.我在这里想念什么?

But the custom.css is not loaded, I do not see it in the source code of the frontend. What am I missing here?

推荐答案

啊,我的错我找到了!

文件名应为FrontController.php,要加载该文件,必须手动删除cache/class_index.php文件!

The name of the file should be FrontController.php and for this to be loaded, you have to manually delete the cache/class_index.php file!

这篇关于Prestashop 1.6中的替代控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆