-
Notifications
You must be signed in to change notification settings - Fork 51
Trying to get a factory/service inside resource #184
Comments
REST resource is created via container (service manager, if it is there defined) or directly: |
Yes, but my ResourceFactory is not called or if I put a "exit" inside file, the php continues. :'( I cloned apigility default project. |
I just cloned the project, I created the service in apigility admin but ResourceFactory is never called or used. |
Did you add to your configuration: 'service_manager' => [
'factories' => [
YourApi\V1\Rest\YourService\Resource::class => YourResourceFactory::class,
],
], ? You can use also abstract factory if you want, or the same factory for multiple resources. |
No I didn't. But I need to include this config inside module config or in global config? |
Yeah Nice, it works like a charm. Big thanks dude <3 |
Doesn't matter. If this is just for one module it should be in module.config.php. If this is a global configuration for your application (applied for multiple modules) than it can be in global config. |
You can close this issue and a lot of people are searching for this in "google" or "stackoverflow". Big thanks and HNY ;) |
This repository has been closed and moved to laminas-api-tools/api-tools; a new issue has been opened at laminas-api-tools/api-tools#10. |
Tell me one thing if you can help me:
How can I get a Factory/Service inside a resource?
The text was updated successfully, but these errors were encountered: