form_set_cache
includes/form.inc, строка 220
- Версии
- 6
form_set_cache($form_build_id, $form, $form_state)
Сохраняет форму в кэше.
Связанные темы
Код
<?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);
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии