I am coding my own Drupal module and working with the form api to create the fields that make up the form on a page. I have fields defined like: $form['username'].
Now i would like to have a fieldset for the fields, which results in 开发者_如何学Pythonthe following definition: $form["settings"]["username"].
Question: which other code does this affect? for example i have code like $form_state['values']['username'], does this need to be changed?
Yes, you would need to delve into those levels. Therefore, in order to access $form['settings']['username']
, use $form_state['values']['settings']['username']
.
No, the $form_state['values']['username']
would be the same, unless you set '#tree' => true
in the fieldset, then you would use $form_state['values']['settings']['username']
.
精彩评论