@@ -688,7 +688,7 @@ specify it:
688
688
689
689
<?php echo $view['form']->label($form['task'], 'Task Description') ?>
690
690
691
- Finally, some field types have additional rendering options that can be passed
691
+ Some field types have additional rendering options that can be passed
692
692
to the widget. These options are documented with each type, but one common
693
693
options is ``attr ``, which allows you to modify attributes on the form element.
694
694
The following would add the ``task_field `` class to the rendered input text
@@ -706,6 +706,33 @@ field:
706
706
'attr' => array('class' => 'task_field'),
707
707
)) ?>
708
708
709
+ If you need to render form fields "by hand" then you can access individual
710
+ values for fields such as the ``id ``, ``name `` and ``label ``. For example
711
+ to get the ``id ``:
712
+
713
+ .. configuration-block ::
714
+
715
+ .. code-block :: html+jinja
716
+
717
+ {{ form.task.vars.id }}
718
+
719
+ .. code-block :: html+php
720
+
721
+ <?php echo $form['task']->get('id') ?>
722
+
723
+ To get the value used for the form field's name attribute you need to use
724
+ the ``full_name `` value:
725
+
726
+ .. configuration-block ::
727
+
728
+ .. code-block :: html+jinja
729
+
730
+ {{ form.task.vars.full_name }}
731
+
732
+ .. code-block :: html+php
733
+
734
+ <?php echo $form['task']->get('full_name') ?>
735
+
709
736
Twig Template Function Reference
710
737
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
711
738
0 commit comments