Prestashop 1.6 Controller override

北战南征 提交于 2020-02-25 04:33:23

问题


I know how to override things in Prestashop. I'm trying to override Category Controller to display custom categories (different template with different data).

I copied CategoryController to /modules/mymodule/override/controllers/front and I have module controller at /modules/mymodule/controllers/front/display.php and there's initContent method.

How can I use modified CategoryController in my display.php controller?


回答1:


You have created two different controllers:

  1. Overriden CategoryController
  2. ModuleController

Using 1. within 2. is nonesense - which means that you do something semantically wrong. If you want to to display custom categories with different template you need only to override the CategoryController, and set the proper template (if you will use two different templates for displaying categories). If you need only one template, just override the controller and change the theme template.



来源:https://stackoverflow.com/questions/25086802/prestashop-1-6-controller-override

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!