File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,44 @@ the actual type of the two underlying fields. The ``options`` option is passed
5252to each of those individual fields, meaning - in this example - any option
5353supported by the ``password `` type can be passed in this array.
5454
55+ Rendering
56+ ~~~~~~~~~
57+
58+ The repeated field type is actually two underlying fields, which you can
59+ render all at once, or individually. To render all at once, use something
60+ like:
61+
62+ .. configuration-block ::
63+
64+ .. code-block :: jinja
65+
66+ {{ form_row(form.password) }}
67+
68+ .. code-block :: php
69+
70+ <?php echo $view['form']->row($form['password']) ?>
71+
72+ To render each field individually, use something like this:
73+
74+ .. configuration-block ::
75+
76+ .. code-block :: jinja
77+
78+ {{ form_errors(form.password) }}
79+ {{ form_row(form.password.first) }}
80+ {{ form_row(form.password.second) }}
81+
82+ .. code-block :: php
83+
84+ <?php echo $view['form']->errors($form['password']) ?>
85+ <?php echo $view['form']->row($form['password']['first']) ?>
86+ <?php echo $view['form']->row($form['password']['second']) ?>
87+
88+ .. note ::
89+
90+ The sub-field names are ``first `` and ``second `` by default, but can
91+ be controlled via the `first_name `_ and `second_name `_ options.
92+
5593Validation
5694~~~~~~~~~~
5795
You can’t perform that action at this time.
0 commit comments