symfony/symfony — pull request #12050 by webmozart (2014-09-26 09:56:10+00:00)
Title: [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 | TODO

This 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.