You are here

public function CacheControlBlockForm::submitForm in Akamai 8

Same name and namespace in other branches
  1. 8.2 src/Form/CacheControlBlockForm.php \Drupal\akamai\Form\CacheControlBlockForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

lib/Drupal/akamai/Form/CacheControlBlockForm.php, line 75
Contains \Drupal\akamai\Form\CacheControlBlockForm.

Class

CacheControlBlockForm
Defines a form that configures Akamai settings.

Namespace

Drupal\akamai\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $values = $form_state['values'];
  $path = $values['path'];
  $did_clear = akamai_clear_url($path, array(), $form['#node']);
  if ($did_clear) {
    $message = t("Akamai Cache Request has been made successfully, please allow 10 minutes for changes to take effect.");
    drupal_set_message($message);
  }
  else {
    drupal_set_message(t("There was a problem clearing the cache for this page.  Check your log messages for more information."), 'error');
  }
}