You are here

function varnish_form_alter in Varnish 6

Same name and namespace in other branches
  1. 5 varnish.module \varnish_form_alter()

Implementation of hook_form_alter()

Add our submit callback to the "clear caches" button.

File

./varnish.module, line 163
varnish.module Provide drupal hooks for integration with the Varnish control layer.

Code

function varnish_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'system_performance_settings') {
    $form['clear_cache']['clear']['#submit'][] = 'varnish_purge_all_pages';
  }
}