0
我想更改我的config.yml的值 我需要將其從DefaultController.php中更改,但我不知道這是否可能(以及是否有可能如何去做吧)。如何在Symfony中更改控制器中的YAML值
的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
我需要從defaultcontroller更改「已啓用」爲false時,用戶不希望使用此選項。
關於配置涉及的綁定的信息也不錯。您不能在運行時實際修改YAML配置,但在大多數情況下,該捆綁包將填充可從容器訪問的值對象。雖然這可能仍然不起作用,因爲捆綁可能在你的控制器之前完成了它的職責。所以請提供捆綁信息,那麼你可能會得到一些答案。 –
感謝您的迴應! 該文檔可以在這裏找到:https://github.com/scheb/two-factor-bundle/blob/master/Resources/doc/configuration.md 但是我找不到任何有關啓用/禁用「啓用」選項 –