1 theming_example.module theming_example_text_form($form, &$form_state)

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


modules/examples/theming_example/theming_example.module, line 252
Explains how a module declares theme functions, preprocess functions, and templates.


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;