1 form_test.module form_test_storage_page_cache_form($form, &$form_state)

A simple form for testing form storage when page caching is enabled.

File

core/modules/simpletest/tests/form_test.module, line 961
Helper module for the Form API tests.

Code

function form_test_storage_page_cache_form($form, &$form_state) {
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => 'Title',
    '#required' => TRUE,
  );

  $form['test_build_id_old'] = array(
    '#type' => 'item',
    '#title' => 'Old build id',
    '#markup' => 'No old build id',
  );

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
  );

  $form['rebuild'] = array(
    '#type' => 'submit',
    '#value' => 'Rebuild',
    '#submit' => array('form_test_storage_page_cache_rebuild'),
  );

  $form['#after_build'] = array('form_test_storage_page_cache_old_build_id');
  $form_state['cache'] = TRUE;

  return $form;
}