form_set_cache

Definition

form_set_cache($form_build_id, $form, $form_state)
includes/form.inc, line 233

Description

Store a form in the cache

Related topics

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

Code

<?php
function form_set_cache($form_build_id, $form, $form_state) {
  // 6 hours cache life time for forms should be plenty.
  $expire = 21600;

  cache_set('form_' . $form_build_id, $form, 'cache_form', time() + $expire);
  if (!empty($form_state['storage'])) {
    cache_set('storage_' . $form_build_id, $form_state['storage'], 'cache_form', time() + $expire);
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.