Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Form] Automated label generation for forms#11456
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should benull === $options['label'] (also in the expressions below).
alexandresalome commentedAug 11, 2014
@webmozart do you agree on the implementation? I'll work on documentation PRs as soon as the implementation is validated here |
webda2l commentedAug 11, 2014
Seehttps://github.com/Elao/ElaoFormTranslationBundle if you don't know already it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the parameter name looks weird withauto_label being duplicated.form.type_extension.auto_label.format might be better
webmozart commentedSep 26, 2014
Thanks for the idea and PR@alexandresalome! I had a little different solution in mind, which I uploaded in#12050. Please let me know whether this is convenient for you. Cheers! |
This PR was merged into the 2.6-dev branch.Discussion----------[Form] Added "label_format" option| Q | A| ------------- | ---| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#11456| License | MIT| Doc PR | TODOThis PR replaces#11456. It adds a "label_format" option which allows to configure a format for generating labels. Two placeholders are available: `%name%` and `%id%`.**Feedback wanted**: Should we change the placeholders to `{{ name }}` and `{{ id }}`?The option is inherited from the parent form if not set explicitly on a field:```php$form = $this->createForm('myform', $data, array('label_format' => 'form.label.%id%'));```Follow-up PR: Make the default label format and translation domain configurable in config.yml.Commits-------aad442d [Form] Added "label_format" option
Discussion started in#11298
This PR is about adding an option to automate the label generation for forms:
This option would be useful for big I18Ned applications with standardized label form translations. We could also add an option for a defaulttranslation_domain.
I started this work as a third-party extension, because most applications don't need it, so the footprint is null for them.
What is your advice on it?