@@ -28,18 +28,15 @@ Enable the bundle in the kernel
28
28
29
29
``` php
30
30
<?php
31
- // app/AppKernel .php
31
+ // config/bundles .php
32
32
33
- public function registerBundles()
34
- {
35
- $bundles = [
36
- // ...
37
- new Sherlockode\ConfigurationBundle\SherlockodeConfigurationBundle(),
38
- ];
39
- }
33
+ return [
34
+ // ...
35
+ Sherlockode\ConfigurationBundle\SherlockodeConfigurationBundle::class => ['all' => true],
36
+ ];
40
37
```
41
38
42
- You will need a Parameter entity in order to store the configuration values in the database.
39
+ You will need a ` Parameter ` entity in order to store the configuration values in the database.
43
40
44
41
``` php
45
42
<?php
@@ -79,13 +76,15 @@ class Parameter extends BaseParameter
79
76
The entity class you just created must be set in the bundle's configuration:
80
77
81
78
``` yaml
79
+ # config/packages/sherlockode_configuration.yaml
82
80
sherlockode_configuration :
83
81
entity_class :
84
82
parameter : App\Entity\Parameter
85
83
` ` `
86
84
87
85
Now you are free to define any configuration entry you'd like by using the ` parameters` key:
88
86
` ` ` yaml
87
+ # config/packages/sherlockode_configuration.yaml
89
88
sherlockode_configuration:
90
89
entity_class:
91
90
parameter: App\E ntity\P arameter
@@ -113,6 +112,7 @@ If you want to use translations you can define a `translation_domain` key global
113
112
and use your translation key as the label.
114
113
115
114
` ` ` yaml
115
+ # config/packages/sherlockode_configuration.yaml
116
116
sherlockode_configuration:
117
117
translation_domain: my_app_domain # default domain is false (no translation)
118
118
parameters:
@@ -135,6 +135,7 @@ The other options are up to the field and its needs. For instance, the choice fi
135
135
` multiple` and `choices` options in order to customize the form.
136
136
137
137
` ` ` yaml
138
+ # config/packages/sherlockode_configuration.yaml
138
139
sherlockode_configuration:
139
140
parameters:
140
141
guess_access:
@@ -164,6 +165,7 @@ sherlockode_configuration:
164
165
You can also modify the default template used by this controller with the `templates` configuration entry point :
165
166
166
167
` ` ` yaml
168
+ # config/packages/sherlockode_configuration.yaml
167
169
sherlockode_configuration:
168
170
templates:
169
171
edit_form: 'Parameter/my_parameter_list.html.twig'
@@ -219,6 +221,7 @@ You can export or import parameters in a yaml file. You have two routes for thes
219
221
You also can customize the import form template by defining your own in the configuration :
220
222
221
223
` ` ` yaml
224
+ # config/packages/sherlockode_configuration.yaml
222
225
sherlockode_configuration:
223
226
templates:
224
227
import_form: 'Parameter/my_import_form.html.twig'
0 commit comments