Symfony2 Use PHP Class Constant in YAML Config?

后端 未结 6 1835
梦如初夏
梦如初夏 2020-12-15 05:45

I know this is probably not possible, but is there a clean way to use a PHP class constant within a YAML config/services/etc. file for Symfony2?

For example, if I ha

6条回答
  •  情书的邮戳
    2020-12-15 06:19

    For Symfony >=2.4 you can use expression language

    Example:

    '@=constant("Symfony\\Bridge\\Monolog\\Logger::INFO")'
    

提交回复
热议问题