【发布时间】:2021-04-13 07:16:41
【问题描述】:
在自定义命令中使用默认 Sylius CompositeChannelContext 会出错,找不到该频道。
[Sylius\Component\Channel\Context\ChannelNotFoundException]
Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development.
在 Profiler 中更改它并没有什么不同。
我应该如何在 Command 中使用 ChannelContext?
【问题讨论】:
-
目前,当有多个通道时,无法在命令中使用通道上下文。您可以添加一个新的上下文,它将在 CLI 模式下返回您想要的任何通道。 docs.sylius.com/en/1.9/book/configuration/channels.html
-
感谢@VictorVasiloi 的建议,它有帮助
标签: sylius