I want to set an alias for a service in order to be able to use different services in different environments.
So, here is the services.yaml
.
.
.
register_request:
alias: %register_request_service%
main_register_request:
class: AppBundle\Services\Requests\RegisterRequest
null_register_request:
class: AppBundle\Services\Requests\NullRegisterRequest
.
.
.
and in my development environment the parameters.yml
looks like:
.
.
.
register_request_service: null_register_request
.
.
.
But it does not work! when I use clear:cache
it says:
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to replace alias "%register_request_service%" with "register_request".
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The service definition "%register_request_service%" does not exist.
Any Idea about what I'm missing?
parameters.yml
. – Tavie