例如,我在widget.xml几个参数中定义了一个小部件
<parameters>
<headline translate="label">
<visible>1</visible>
<label>Display Amount</label>
<type>text</type>
<required>1</required>
</dheadline>
</parameters>
Run Code Online (Sandbox Code Playgroud)
如何在用户创建窗口小部件时为后端的配置字段中显示此类参数的默认值.
我们目前在Web服务器集群中使用基于文件的缓存,导致Magento在每个Web服务器上具有不同的缓存.因此,自动缓存清除 - 例如,如果您在后端进行配置设置 - 不起作用.
您推荐哪种缓存系统:
memcached的PHP模块似乎有问题.
我重写了一个像这样的控制器:
<frontend>
<routers>
<checkout>
<args>
<modules>
<My_Foo before="Mage_Checkout">My_Foo</My_Foo>
</modules>
</args>
</checkout>
</routers>
Run Code Online (Sandbox Code Playgroud)
我只覆盖一个功能.$this->__('A string');当我在调试器中跟踪它时,控制器的另一个函数(左原始)调用到Mage_Core_Controller_Front_Action::__()转换表达式($expr)是
_text = 'A string',
_module = 'My_Foo'
Run Code Online (Sandbox Code Playgroud)
并且找不到翻译 - 因为它仅在Mage_Checkout.
我认为最好的解决方案是避免控制器重写和使用事件,但这在所有情况下都是不可能的.
是否有任何干净的解决方案 - 除了使用事件 - 将原始翻译保留在覆盖的控制器中?
当覆盖不同插件中的模板时,加载顺序很重要并且取决于插件安装日期。
我相信在最近的 Shopware 版本中可以以更好的方式解决这个问题。
这是如何运作的?
为了清楚地分离Controller层和View层,我不再想要将完整的对象传递给我的视图.相反,我想只传递包含数据但没有任何方法的数组和对象.否则,视图脚本将能够删除Doctrine记录或在对象树中遍历不适合视图的数据.
运行时bin/build-administration.sh我们得到
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-config-airbnb-base@13.2.0
npm ERR! Found: eslint@7.10.0
npm ERR! node_modules/eslint
npm ERR! dev eslint@"7.10.0" from the root project
npm ERR! peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/eslint-plugin@5.1.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! @typescript-eslint/eslint-plugin@"5.1.0" from the root project
npm ERR! 14 more (@typescript-eslint/experimental-utils, eslint-utils, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^4.19.1 || ^5.3.0" from eslint-config-airbnb-base@13.2.0
npm ERR! …Run Code Online (Sandbox Code Playgroud)