Zitat von
Spooky
PHP-Code:
class DownloadResponseListener
{
public function __construct(
private readonly string $projectDir,
private readonly string $uploadPath,
) {
}
}
PHP-Code:
# config/services.yaml
services:
_defaults:
autowire: true
autoconfigure: true
bind:
$projectDir: '%kernel.project_dir%'
$uploadPath: '%contao.upload_path%'
App\:
resource: ../src
Irgendwie bekomm ich das so nciht zum Laufen, bekomme immer den Fehler:
Code:
Cannot autowire service "App\EventListener\DownloadResponseListener": argument "$projectDir" of method "__construct()" is type-hinted "string", you should configure its value explicitly.
muss ich die services.yaml noch irgendwo spezifisch einbinden oder so?
Lesezeichen