Closed bigfoot90 closed 6 years ago
@Tom32i ping
@bigfoot90 may be you can create a pull request ? Instead of just asking for new feature
Sure, just want to be sure you want that feature
why not, if we can disable it
Hey @bigfoot90 sorry for my silence :)
What exactly do you mean by "underscore-ize field names" ?
suppose you have $builder->add('myFieldName');
in form builder,
the translation id will be form.my_form.children.my_field_name.label
Oh all right, that could prove useful.
I'm thinking of implementing it that way:
For now the FormTreeNode gets its name from the field name: new FormTreeNode($view->vars['name'], ...)
. We could add a Transformer that process that value before passing it to the FormTreeNode (the Transformer could be just a closure).
See: https://github.com/Elao/ElaoFormTranslationBundle/blob/master/Builders/FormTreeBuilder.php#L75
All you would have to do then is to create your custom field name transformer (CamelCase to SnakeCase in your case).
@Tom32i I was thinking adding a paramiter in bundle configuration only, do you have need to set the label transformer for each field?
Spring cleaning, If this issue is still relevant, please reopen-it.
Add an option to allow underscore-ize field names