Skip to content
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

Automatically create and wire form type services when possible #367

Open
rimas-kudelis opened this issue Feb 9, 2022 · 0 comments
Open

Comments

@rimas-kudelis
Copy link

The screenshot in the example here currently suggests that a form type service is being automatically created for every custom resource.

This is not true, but I think everyone would benefit if it actually were true. Sylius Standard automatically disables autowiring for all form types which extend AbstractResourceType. This means that we aren't getting any errors about Symfony's inability to autowire the constructor of AbstractResourceType, but whenever a form like that is actually used, the error still pops up, asking you to wire these two arguments manually.

It would be nice if the ResourceBundle's DI took care to wire these two arguments (class name and validation groups) for all forms which extend AbstractResourceType. This would allow us to avoid hardcoding the actual class name in the forms and would nicely complement the way other services (Controller, Factory, Manager, Repository) are created.

@rimas-kudelis rimas-kudelis changed the title Automatically create and wire form services when possible Automatically create and wire form type services when possible Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant