1 theming_example.module | theming_example_select_form($form, &$form_state) |
A simple form that displays a select box and submit button.
This form will be be themed by the 'theming_example_select_form' theme handler.
Related topics
File
- modules/
examples/ theming_example/ theming_example.module, line 202 - Hook implementations for the Theming Example module.
Code
function theming_example_select_form($form, &$form_state) {
$options = array(
'newest_first' => t('Newest first'),
'newest_last' => t('Newest last'),
'edited_first' => t('Edited first'),
'edited_last' => t('Edited last'),
'by_name' => t('By name'),
);
$form['choice'] = array(
'#type' => 'select',
'#options' => $options,
'#title' => t('Choose which ordering you want'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Go'),
);
return $form;
}