开发者

Add radiobutton to hook_form

I want to add radiobuttons to my module. How can I add using Add radiobutton to hoo开发者_如何学运维k_form?


function mymodule_some_form($form_state) {
  $form['radio'] = array(
    '#type' => 'radios',
    '#title' => 'Title',
    '#options' => array(0 => 'First', 1 => 'Second', 3 => 'Third'),
    '#attributes' => array('style' => 'display:inline-block;')
  );

  $form['select'] = array(
    '#type' => 'select',
    '#title' => 'Title',
    '#options' => array(0 => 'First', 1 => 'Second', 3 => 'Third'),
    '#attributes' => array('style' => 'display:inline-block;')
  );
}

See the Drupal FAPI Documentation for more information.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜