Use env vars to trigger hooks
还没有人认领这个 Issue。
评估
调研方向
使用 ENABLE_MY_HOOK 设置为 false 的配置重现 issue 中的 hook 配置,然后检查 hook 配置的处理逻辑,以 выяс明为什么启用值会被忽略。使用环境值 false 和 true 分别确认行为;当 hook 相应地被禁用或启用时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I tried this syntax while creating a hook :
sylius_twig_hooks:
hooks:
'sylius_shop.base.header.top_bar':
my_hook:
template: '/shop/my_hook.html.twig'
priority: 0
enabled: '%env(bool:ENABLE_MY_HOOK)%'
The hook is always enabled, even if the env var ENABLE_MY_HOOK is false.
I tried also to define a parameter like this
parameters:
app.enable_my_hook: '%env(bool:ENABLE_MY_HOOK)%'
And used it in the hook declaration :
sylius_twig_hooks:
hooks:
'sylius_shop.base.header.top_bar':
my_hook:
template: '/shop/my_hook.html.twig'
priority: 0
enabled: '%app.enable_my_hook%'
This feature flag worked when we used Sylius UI twig events in Sylius 1.x
- 主要语言
- PHP
- 星标
- 45
- 派生
- 34
- 平均合并
- 4 天 33 分钟
- 30 天内合并 PR
- 8
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Sylius/Stack 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 84/100
-
documentation
难度 2/5 1-3 小时 新手友好度 55/100
-
feature question
难度 5/5 一周以上 新手友好度 20/100
-
documentation good first issue question
难度 4/5 3-5 天 新手友好度 35/100
-
documentation
难度 3/5 1-2 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
Awaiting Triage
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
WordPress/two-factor#1008 ·
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复