function theming_example_text_form in Examples for Developers 7
A simple form that displays a textfield and submit button.
This form will be rendered by theme('form') (theme_form() by default) because we do not provide a theme function for it here.
Related topics
1 string reference to 'theming_example_text_form'
- theming_example_menu in theming_example/
theming_example.module - Implements hook_menu().
File
- theming_example/
theming_example.module, line 250 - Explains how a module declares theme functions, preprocess functions, and templates.
Code
function theming_example_text_form($form, &$form_state) {
$form['text'] = array(
'#type' => 'textfield',
'#title' => t('Please input something!'),
'#required' => TRUE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Go'),
);
return $form;
}