config.neon does not allow App\Controllers\Xyx... set up
camohub opened this issue · comments
I need to send some params from config.neon to controller. So I tried to write
parameters:
crm:
token: 'qeryuteykljkmjdhgvfarerhhhilhiohiohfrtxgzx'
services:
- App\Controllers\CampaignsController(%crm.token%)
But this throws me an erro which says: Multiple services of type App\Controllers\CampaignsController found: 01, resource.App_Controllers.3.
I dont see any other controller with the same name. It seems Apitte does not allowe to configurate controllers via
public function __contruct($crm_token) {}
How can I do it if it is possible?
All controlleres are discovered & registered by default.
apitte-skeleton/config/ext/apitte.neon
Lines 8 to 11 in 08e1a07
You have to change it.
But how can I send some parameter to controllers __construct()?
I must take a look. I am not using scalar parameters in controllers. I use ParametersService or something like that. But it should work with scalars indeed.
Hi again.
There was bug in contributte/di: contributte/di@cafa65d
Example of StaticController: 426dc1c
Demo: https://examples.contributte.org/apitte-skeleton/api/v1/static/text?_access_token=admin