Skip to content

Commit dc6c80b

Browse files
authored
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.
1 parent 46cc24b commit dc6c80b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

controller/upload_file.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ Then, define a service for this class:
286286
287287
# config/services.yaml
288288
services:
289-
# ...
289+
_defaults:
290+
bind:
291+
string $targetDirectory: '%brochures_directory%'
290292
291293
App\Service\FileUploader:
292294
arguments:

0 commit comments

Comments
 (0)