@@ -41,9 +41,9 @@ You can also render each of the three parts of the field individually:
41
41
.. code-block :: php
42
42
43
43
<div >
44
- <?php echo $view['form']->label($form['age']) }} ?>
45
- <?php echo $view['form']->errors($form['age']) }} ?>
46
- <?php echo $view['form']->widget($form['age']) }} ?>
44
+ <?php echo $view['form']->label($form['age']); ?>
45
+ <?php echo $view['form']->errors($form['age']); ?>
46
+ <?php echo $view['form']->widget($form['age']); ?>
47
47
</div >
48
48
49
49
In both cases, the form label, errors and HTML widget are rendered by using
@@ -71,7 +71,7 @@ just one line:
71
71
72
72
.. code-block :: php
73
73
74
- <?php echo $view['form']->widget($form) }} ?>
74
+ <?php echo $view['form']->widget($form); ?>
75
75
76
76
The remainder of this recipe will explain how every part of the form's markup
77
77
can be modified at several different levels. For more information about form
@@ -645,7 +645,6 @@ which part of the field is being customized. For example:
645
645
<?php echo $view['form']->widget($form['name']); ?>
646
646
647
647
<!-- src/Acme/DemoBundle/Resources/views/Form/_product_name_widget.html.php -->
648
-
649
648
<div class="text_widget">
650
649
echo $view['form']->block('form_widget_simple') ?>
651
650
</div>
@@ -666,6 +665,8 @@ You can also override the markup for an entire field row using the same method:
666
665
667
666
.. code-block :: html+jinja
668
667
668
+ {% form_theme form _self %}
669
+
669
670
{% block _product_name_row %}
670
671
<div class="name_row">
671
672
{{ form_label(form) }}
@@ -674,10 +675,16 @@ You can also override the markup for an entire field row using the same method:
674
675
</div>
675
676
{% endblock %}
676
677
678
+ {{ form_row(form.name) }}
679
+
677
680
.. code-block :: html+php
678
681
679
- <!-- _product_name_row.html.php -->
682
+ <!-- Main template -->
683
+ <?php echo $view['form']->setTheme($form, array('AcmeDemoBundle:Form')); ?>
684
+
685
+ <?php echo $view['form']->row($form['name']); ?>
680
686
687
+ <!-- src/Acme/DemoBundle/Resources/views/Form/_product_name_row.html.php -->
681
688
<div class="name_row">
682
689
<?php echo $view['form']->label($form) ?>
683
690
<?php echo $view['form']->errors($form) ?>
0 commit comments