Open robdmoore opened 9 years ago
I think that Convention's place in the IFormTemplate. It is a more general place for them. I doubt that anyone need to specialize each form in a project with custom conventions.
Possibly.
The way I see it, conventions will be largely project specific. The template you use might be the generic one, but you might want to add conventions still. Also, you might want to swap out the template for a different one.
In saying that I can imagine wanting to define conventions that go with a template as well.
On 22 Nov 2014, at 7:34 pm, zabulus notifications@github.com wrote:
I think that Convention's place in the IFormTemplate. It is a more general place for them. I doubt that anyone need to specialize each form in a project with custom conventions.
— Reply to this email directly or view it on GitHub.
There is something awkward in this proposal, in that the conventions would override configuration set for a form (it is my understanding that the PrepareField stuff is invoked right before rendering, please correct me if I'm wrong). For some attributes, this is not important (eg, the readonly attribute), but for others it would. Your examples have checks for user settings, but that is impossible for properties that are value types (eg, ShouldInlineLabelWrapElement).
Thanks @fsateler. I'll keep that in mind if we get to the point of implementing this.
Happy for you or anyone else to suggest changes or even submit a PR for the change :)
This is a brainstorm of my idea for https://trello.com/c/1hNDoqon/74-ability-to-add-field-configuration-modifiers
It would probably replace the need for #102; I think this is more flexible and means we don't have to deal with crazy generic statics.
Thoughts @bendetat @MattDavies @zabulus?