【发布时间】:2017-08-14 17:11:00
【问题描述】:
我想更改我的 config.yml 的值 我需要从我的 DefaultController.php 中更改它,但我不知道这是否可行(以及是否可行)。
YAML 文件
google:
enabled: true # If Google Authenticator should be enabled, default false
server_name: Zioo # Server name used in QR code
issuer: Zioo # Issuer name used in QR code
template: ZPAdminBundle:Authentication:form.html.twig # Template used to render the authentication form
当用户不想使用此选项时,我需要将默认控制器的“启用”更改为 false。
【问题讨论】:
-
配置相关的捆绑信息也很好。您实际上无法在运行时修改 YAML 配置,但在大多数情况下,捆绑包将填充您可以从容器访问的值对象。尽管这可能仍然不起作用,因为捆绑包可能在您的控制器之前完成了它的职责。因此,请同时提供捆绑信息,然后您可能会得到一些答案。
-
感谢您的回复!文档可以在这里找到:github.com/scheb/two-factor-bundle/blob/master/Resources/doc/… 但是我找不到任何关于启用/禁用“启用”选项的信息
标签: symfony authentication yaml two-step-verification