Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种在管理模块的树枝模板中访问配置参数的方法。我试图通过以下方式访问它:
{{ shopware.config.pluginName.config.fieldName }}
问题是管理模块的树枝模板{{ shopware.config }}不可用。我试图通过它访问它,{{ dump(shopware.config) }}但它什么也没返回。难道我做错了什么?
{{ shopware.config }}
{{ dump(shopware.config) }}
是否可以在管理模块中访问插件的配置参数?
有没有办法将 php 变量传递给管理模块的树枝模板?
提前致谢,
干杯!
尝试使用以下服务:
this.systemConfigApiService.getValues('domain', this.selectedSalesChannelId)
其中 domain 是插件名称。
当然,您应该先注入该服务
inject: ['systemConfigApiService']
使用该服务,您可以为树枝模板提供配置值。