Michael Schramm
Michael Schramm
Won't work unless you move that value into a parameter. to get this working something like https://github.com/schmittjoh/JMSDiExtraBundle/pull/207 would need to be merged.
I needed it for SonataAdminBundle. why don't you create a custom annotation for your needs? It's quite easy and gives you more flexibility https://github.com/wodka/SonataAdminBundle/blob/jms-annotation/Annotation/Admin.php
@Ener-Getick perhaps we can change how argument injection works something like: ``` php /** * @DI\Call({ * "service" = @DI\Argument("@foo"), * "parameter" = @DI\Argument("%some.parameter%"), * "string" = @DI\Argument("bar"), * "array"...
Here you have a good example of why with some new features a default value does not help: ``` php use JMS\DiExtraBundle\Annotation as DI; /** * @DI\Service("api.first") * @DI\Service("api.second") */...
for the injection to work you need to have only one docblock: ``` /** * @DI\InjectParams({ * "em" = @DI\Inject("doctrine.orm.entity_manager"), * "session" = @DI\Inject("session") * }) * @param $em *...
Hi, for both cases you could create a custom annotation -> similar to https://github.com/wodka/SonataAdminBundle/blob/jms-annotation/Annotation/Admin.php it would also be possible to extend your trait and define the annotation there.
could be a nice addition to: https://github.com/schmittjoh/JMSDiExtraBundle/pull/240
perhaps something like: ``` @Service( "first.service", initMethod="setup", initMethodInject=@InjectParams({ "system" =@Inject("%first%) }) ) @Service( "second.service", initMethod = "setup", initMethodInject = @InjectParams({ "system" = @Inject("%second%) }) ) ``` Ideas?
@Ener-Getick I just added the support for AfterSetup services
there is already a pull request: https://github.com/schmittjoh/JMSDiExtraBundle/pull/163