Last active
December 21, 2015 08:39
-
-
Save h4cc/6280029 to your computer and use it in GitHub Desktop.
When using a service alias, a parameter in case of the alias name can NOT be used.
Exceptions:
'InvalidArgumentException: Unable to replace alias "%my_alias%" with "bar".'
'InvalidArgumentException: The service definition "%my_alias%" does not exist.'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
my_alias: foo | |
services: | |
foo: | |
class: Example\Foo | |
bar: | |
alias: %my_alias% | |
#-------------------------------------------- | |
# For clarification, a real life example: | |
# fos_user.repository.user would be a service from a different bundle. | |
# Via parameter the used service should be abled to change. | |
parameters: | |
my_bundle.repository.user.alias: fos_user.repository.user | |
services: | |
my_bundle.repository.user: | |
alias: %my_bundle.repository.user.alias% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment