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
This is possible, but only when using eval'd code, which is generally frowned upon.
Given a class constant Permission::ACCESS_NONE e.g. you could do something like this in the yaml file:
permission: ACCESS_NONE
and the following in the code where you parse the yaml:
eval("return \The\Complete\Namespace\To\Permission::".$context['permission'].";");
This is of course butt-ugly code but it does work.