From dc6c80b350ca8948d59b9426e84bf7330069e870 Mon Sep 17 00:00:00 2001 From: bkb_bkb <39589466+foybkaa@users.noreply.github.com> Date: Thu, 24 Apr 2025 09:57:41 +0200 Subject: [PATCH] Update upload_file.rst Clarified that when injecting scalar parameters (like a string for the upload directory) into a service, it's necessary to use the bind configuration in services.yaml if autowiring alone is not sufficient. This helps avoid the "Cannot autowire service... string expected" error when following the tutorial. --- controller/upload_file.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/upload_file.rst b/controller/upload_file.rst index b3dc2d6ffd0..6cf51cc25ef 100644 --- a/controller/upload_file.rst +++ b/controller/upload_file.rst @@ -286,7 +286,9 @@ Then, define a service for this class: # config/services.yaml services: - # ... + _defaults: + bind: + string $targetDirectory: '%brochures_directory%' App\Service\FileUploader: arguments: