@@ -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
@@ -646,7 +646,6 @@ customize the ``name`` field only:
646
646
<?php echo $view['form']->widget($form['name']); ?>
647
647
648
648
<!-- src/Acme/DemoBundle/Resources/views/Form/_product_name_widget.html.php -->
649
-
650
649
<div class="text_widget">
651
650
echo $view['form']->block('form_widget_simple') ?>
652
651
</div>
@@ -667,7 +666,6 @@ You can also override the markup for an entire field row using the same method:
667
666
668
667
.. code-block :: html+jinja
669
668
670
- {# _product_name_row.html.twig #}
671
669
{% form_theme form _self %}
672
670
673
671
{% block _product_name_row %}
@@ -678,10 +676,16 @@ You can also override the markup for an entire field row using the same method:
678
676
</div>
679
677
{% endblock %}
680
678
679
+ {{ form_row(form.name) }}
680
+
681
681
.. code-block :: html+php
682
682
683
- <!-- _product_name_row.html.php -->
683
+ <!-- Main template -->
684
+ <?php echo $view['form']->setTheme($form, array('AcmeDemoBundle:Form')); ?>
685
+
686
+ <?php echo $view['form']->row($form['name']); ?>
684
687
688
+ <!-- src/Acme/DemoBundle/Resources/views/Form/_product_name_row.html.php -->
685
689
<div class="name_row">
686
690
<?php echo $view['form']->label($form) ?>
687
691
<?php echo $view['form']->errors($form) ?>
0 commit comments