Open michalbundyra opened 4 years ago
Hi, when create new api from the interface it was a nice think to create the invoke of the resource factory in this way:
public function __invoke($services) { return new MyResouceResource($services); }
and inside the resouce file a constructor like this:
public function __construct($services) { $config = $services->get('Config'); }
so we can manage the config keys and the database setting and adapter. Thanks
Originally posted by @radici at https://github.com/zfcampus/zf-apigility/issues/74
Hi, when create new api from the interface it was a nice think to create the invoke of the resource factory in this way:
public function __invoke($services) { return new MyResouceResource($services); }
and inside the resouce file a constructor like this:
public function __construct($services) { $config = $services->get('Config'); }
so we can manage the config keys and the database setting and adapter. Thanks
Originally posted by @radici at https://github.com/zfcampus/zf-apigility/issues/74