Skip to content

[Form] Reduce code duplication between FormHelper and FormExtension #3905

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
webmozart opened this issue Apr 12, 2012 · 3 comments
Closed

[Form] Reduce code duplication between FormHelper and FormExtension #3905

webmozart opened this issue Apr 12, 2012 · 3 comments

Comments

@webmozart
Copy link
Contributor

The duplicated code in FormHelper (FrameworkBundle) and FormExtension (Twig bridge) should be extracted into a common base class Symfony\Component\Form\AbstractRenderer. It's interface should be extracted into a new Symfony\Component\Form\FormRendererInterface (containing the render*() methods of FormExtension).

The engine specific code should be placed in TwigRenderer (Twig bridge) and TemplatingRenderer (FrameworkBundle). FormHelper and FormExtension can then simply create such a renderer object and forward any method calls to the renderer.

@fabpot: Is the Templating component already able to load templates from components? If yes, we should definitely move FormHelper, TemplatingRenderer and the PHP templates to the Form (or Templating) component to make it self-contained (and usable without FrameworkBundle).

@vicb: Can you do this?

@vicb
Copy link
Contributor

vicb commented Apr 12, 2012

I won't be able to look at this before next week.

@webmozart
Copy link
Contributor Author

Sure, take your time.

@stof
Copy link
Member

stof commented Jul 15, 2012

Closing as there is now a PR in #4918

@stof stof closed this as completed Jul 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants