开发者

Drupal: APi coding and fields in a fieldset

开发者 https://www.devze.com 2023-02-06 13:10 出处:网络
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\'].

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'].

0

精彩评论

暂无评论...
验证码 换一张
取 消