本地与核心控制器 [英] local vs core controller

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

问题描述

我要在本地管理应用程序/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php中添加新的列和操作,但是效果很好.本地控制器/app/code/local/Mage/Adminhtml/Block/Catalog/Product.php未使用或未使管理员超载一个/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php .

I am adding new column and action in the local admin app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php which works fine, however. The local controller/app/code/local/Mage/Adminhtml/Block/Catalog/Product.php is not being used or is not overloading the admin one /app/code/core/Mage/Adminhtml/Block/Catalog/Product.php.

这几乎是Magento 1.4.0.1的全新安装.我是唯一一个正在工作的人,因此我知道某些自定义控制器不会使它过载.我已禁用所有自定义模块.我已经回滚了大部分更改.我已经检查了/etc/Modules/Mage_Catalog.xml.刷新缓存所有可能的方式,登录和注销.什么也没有……仍然使用核心控制器副本.为什么?您如何解决问题,即magento在何时决定在核心副本或本地副本之间使用? ...这更加奇怪,因为它不解析本地Adminhtml config.xml,但使用本地Adminthml块副本.

This is almost fresh install of Magento 1.4.0.1. I am the only one working, so i know it is not overloaded by some custom controller. I have disabled all custom modules. I have rolled back most of my changes. I have checked /etc/Modules/Mage_Catalog.xml. Refreshed cache all possible ways, loged in and out. Nothing....still using the core controller copy. why? How do you troubleshoot, meaning, at what moment magento decides using between core or local copies? ...its even more strange because it does not parse local Adminhtml config.xml but uses local Adminthml copy of Blocks.

我想将所有内容都保留在本地代码中.

I would like to keep everything in local code.

推荐答案

对不起,我糟糕的...长时间工作使我不那么小心.

Sorry, my bad...long hours working makes me less careful.

对于每个模块,都必须在本地或核心空间中启用.默认情况下,它们都在核心空间中启用.要启用Adminhtml模块,我必须在其中添加Mage_Adminhtml.xml文件. app/etc/Modules.在Mage_Adminhtml.xml文件中,我必须在codePool标记之间指定本地,如下所示:

For every module it has to be enabled in local or core space. By default, they all are enabled in the core space. To enable Adminhtml module i had to add Mage_Adminhtml.xml file in app/etc/Modules. In the Mage_Adminhtml.xml file i have to specify local between codePool tags like below:

 <?xml version="1.0"?>
   <config>  
       <modules>  
         <Mage_Adminhtml>
                    <active>true</active>  
                    <codePool>local</codePool>
         </Mage_Adminhtml>   
       </modules>   
  </config> 

我的错误是因为我正在使用管理控制器,因此实际上我需要Adminhtml来使用目录模块.添加Mage_Adminhtml.xml后,它将使用本地控制器.

My mistake was thinking i needed this for Catalog Module while actually for Adminhtml since I am working with admin controllers. Once added Mage_Adminhtml.xml it uses local controllers.

这篇关于本地与核心控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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