Add column option, definition in config & adapt form

Exemple for configuration :

```
chill_custom_fields:
    customizables_entities:
        -
            class: Chill\ReportBundle\Entity\Report
            name: ReportEntity
            options:
                summary_fields: {key: abc, form_type: text, form_options: { required: false }}
```
This commit is contained in:
2015-02-24 21:15:02 +01:00
parent 960ba13555
commit 0c2b5f3fb4
5 changed files with 109 additions and 4 deletions

View File

@@ -22,6 +22,8 @@ class Configuration implements ConfigurationInterface
$classInfo = "The class which may receive custom fields";
$nameInfo = "The name which will appears in the user interface. May be translatable";
$optionsInfo = "Options available for custom fields groups referencing this class";
$prototypeTypeInfo = "The name of the form to append";
$customizableEntitiesInfo = "A list of customizable entities";
$rootNode
@@ -33,9 +35,24 @@ class Configuration implements ConfigurationInterface
->children()
->scalarNode('class')->isRequired()->info($classInfo)->end()
->scalarNode('name') ->isRequired()->info($nameInfo) ->end()
->arrayNode('options')
->info($optionsInfo)
->defaultValue(array())
->useAttributeAsKey('key')
->prototype('array')
->children()
->scalarNode('form_type')
->isRequired()
->info($prototypeTypeInfo)
->end()
->variableNode('form_options')
->defaultValue(array())
->end()
->end()
->end()
->end()
->end()
->end()
->end()
;
return $treeBuilder;