contributte / apitte-skeleton

🎁 API / REST API / JSON API / PSR-7 / Middlewares project skeleton based on Nette Framework (@nette), Apitte (@apitte), Doctrine (@nettrine) and Contributte (@contributte) libraries by @f3l1x.

Home Page:https://examples.contributte.org/apitte-skeleton/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

config.neon does not allow App\Controllers\Xyx... set up

camohub opened this issue · comments

commented

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.

resource:
resources:
App\Module\:
paths: [%appDir%/module]

You have to change it.

commented

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.