2
votes

As the Symfony2 documentation describes, it's possible to inject an "expression language" string as a service argument, but it apperently doesn't work, even with a simple implementation :

services:
    my_service:
        class:     AAA\BBBBundle\ClassName
        arguments: ["@=container.hasParameter('param_name') ? parameter('param_name') : 'default_value'"]

i got:

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException' with message 'The service "my_service" has a dependency on a non-existent service "=container.hasparameter('some_param') ? parameter('some_param') : 'default_value'".' in /[...]/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 59

have i missed something ?

1
Do you use Symfony 2.4?A.L
What version of Symfony are you running?DonCallisto
i am currently under the 2.3.9 version of Symfony, indeed it's composer.json file does'nt contain yet the Expression language bundle, so the problem come surely from here, thanks for the scent !Mohamed Ayoub BENJELLOUN

1 Answers

1
votes

Try to clear fully app/cache dir