Le 18/05/2011 15:48, Valera a écrit :
Hello,

I'm overriding the "templating.helper.assets" class in my config.yml
file and have to replicate the following constructor argument from
templating_php.xml:

<argument type="service" id="request" strict="false" />

Trying it the following way:

     templating.helper.assets:
         class: %templating.helper.assets.class%
         arguments: {type:service, id:@request, strict:false}
         calls:
             - [setMyService, [@my.service]]

But still getting the ScopeWideningInjectionException:

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection
\Exception\ScopeWideningInjectionException' with message 'Scope
Widening Injection detected: The definition "templating.helper.assets"
references the service "request" which belongs to a narrower scope.
Generally, it is safer to either move "templating.helper.assets" to
scope "request" or alternatively rely on the provider pattern by
injecting the container itself, and requesting the service "request"
each time it is needed. In rare, special cases however that might not
be necessary, then you can set the reference to strict=false to get
rid of this error.' in D:\symfony2_test\app1\vendor\symfony\src\Symfony
\Component\DependencyInjection\Compiler\CheckReferenceValidityPass.php
on line 131


Any ideas on how to rewrite the XML behavior into YAML?

@my.service=

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to