(these services are view helpers with their dependencies).
The problem is that $service2 is the exact same object as $service1 whereas it should have different dependencies. I tried to study the thing a bit, and it seems that the $creationOptions are not updated when assigning $service2 despite the valueType is completely different.
Re: ZF2 instantiating classes from factories using MutableCreationOptionsTrait: creates the same instance of class no matter what
This post has NOT been accepted by the mailing list yet.
The service must be marked as "not shared" in order to make this work. By default, services are shared, so they won't be re-created over multiple requests of the same service name.
(these services are view helpers with their dependencies).
The problem is that $service2 is the exact same object as $service1 whereas it should have different dependencies. I tried to study the thing a bit, and it seems that the $creationOptions are not updated when assigning $service2 despite the valueType is completely different.
What is wrong?
If you reply to this email, your message will be added to the discussion below: