Skip to content

Update upload_file.rst #20912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update upload_file.rst #20912

wants to merge 1 commit into from

Conversation

foybkaa
Copy link

@foybkaa foybkaa commented Apr 24, 2025

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.

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.
@OskarStark
Copy link
Contributor

What about using the #[Autowire] attribute instead?

@foybkaa
Copy link
Author

foybkaa commented Apr 24, 2025

What about using the #[Autowire] attribute instead?

Yes, you're right... it’s more modern but can destabilize people working with Symfony 5/6

@foybkaa foybkaa closed this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants