form_set_cache

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 form_set_cache($form_build_id, $form, $form_state)

Store a form in the cache.

Verwandte Themen

▾ 4 functions call form_set_cache()

book_form_update in modules/book/book.pages.inc
Renders a new parent page select element when the book selection changes.
drupal_get_form in includes/form.inc
Retrieves a form from a constructor function, or from the cache if the form was built in a previous page-load. The form is then passed on for processing, after and rendered for display if necessary.
drupal_rebuild_form in includes/form.inc
Retrieves a form, caches it and processes it with an empty $_POST.
upload_js in modules/upload/upload.module
Menu-callback for JavaScript-based uploads.

Code

includes/form.inc, line 222

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

  if ($user->uid) {
    $form['#cache_token'] = drupal_get_token();
  }
  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);
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen