Quantcast
Channel: Form API
Viewing all articles
Browse latest Browse all 18

Drupal form's #tree option

$
0
0
Drupal form's #tree option

There may be a need to name the form elements in an array structure how the form is built. You can see this in Ubercart checkout pane form's input elements. This is very useful when one has a large multi-part form which can be grouped easily by their POST content's array format.

Eg: panes[delivery][delivery_first_name]

A simple flag on you $form construct array will do the trick. It's the #tree option. For whichever elements you set this #tree option, the element's children will be named with full reference to its parents.

vanniaTue, 09/27/2016 - 13:08
Drupal Form Tree Option

Viewing all articles
Browse latest Browse all 18

Latest Images

Trending Articles





Latest Images