form_get_cache

Definition

form_get_cache($form_build_id, &$form_state)
includes/form.inc, line 237

Description

Fetch a form from cache.

Related topics

Namesort iconDescription
Form generationFunctions to enable the processing and display of HTML forms.

Code

<?php
function form_get_cache($form_build_id, &$form_state) {
  global $user;
  if ($cached = cache_get('form_'. $form_build_id, 'cache_form')) {
    $form = $cached->data;
    if ((isset($form['#cache_token']) && drupal_valid_token($form['#cache_token'])) || (!isset($form['#cache_token']) && !$user->uid)) {
      if ($cached = cache_get('storage_'. $form_build_id, 'cache_form')) {
        $form_state['storage'] = $cached->data;
      }
      return $form;
    }
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.