@@ -129,7 +129,7 @@ link for details), create a ``gender_widget`` block to handle this:
129
129
130
130
.. code-block :: html+php
131
131
132
- <!-- src/Acme/DemoBundle/Resources/views/Form/gender_widget.html.twig -->
132
+ <!-- src/Acme/DemoBundle/Resources/views/Form/gender_widget.html.php -->
133
133
<?php if ($expanded) : ?>
134
134
<ul <?php $view['form']->block($form, 'widget_container_attributes') ?>>
135
135
<?php foreach ($form as $child) : ?>
@@ -151,6 +151,8 @@ link for details), create a ``gender_widget`` block to handle this:
151
151
Further, the main config file should point to the custom form template
152
152
so that it's used when rendering all forms.
153
153
154
+ When using Twig this is:
155
+
154
156
.. configuration-block ::
155
157
156
158
.. code-block :: yaml
@@ -181,6 +183,51 @@ link for details), create a ``gender_widget`` block to handle this:
181
183
),
182
184
));
183
185
186
+ For the PHP templating engine, your configuration should look like this:
187
+
188
+ .. configuration-block ::
189
+
190
+ .. code-block :: yaml
191
+
192
+ # app/config/config.yml
193
+ framework :
194
+ templating :
195
+ form :
196
+ resources :
197
+ - ' AcmeDemoBundle:Form'
198
+
199
+ .. code-block :: xml
200
+
201
+ <!-- app/config/config.xml -->
202
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
203
+ <container xmlns =" http://symfony.com/schema/dic/services"
204
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
205
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
206
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
207
+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
208
+
209
+ <framework : config >
210
+ <framework : templating >
211
+ <framework : form >
212
+ <framework : resource >AcmeDemoBundle:Form</twig : resource >
213
+ </framework : form >
214
+ </framework : templating >
215
+ </framework : config >
216
+ </container >
217
+
218
+ .. code-block :: php
219
+
220
+ // app/config/config.php
221
+ $container->loadFromExtension('framework', array(
222
+ 'templating' => array(
223
+ 'form' => array(
224
+ 'resources' => array(
225
+ 'AcmeDemoBundle:Form',
226
+ ),
227
+ ),
228
+ ),
229
+ ));
230
+
184
231
Using the Field Type
185
232
--------------------
186
233
0 commit comments