2

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 ?

3
  • 2
    Do you use Symfony 2.4? Commented Jan 28, 2014 at 16:27
  • 1
    What version of Symfony are you running? Commented Jan 28, 2014 at 16:28
  • 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 ! Commented Jan 29, 2014 at 9:55

1 Answer 1

1

Try to clear fully app/cache dir

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.