public function FormController::submitForm

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides FormInterface::submitForm

File

drupal/core/modules/system/tests/modules/condition_test/lib/Drupal/condition_test/FormController.php, line 62
Contains \Drupal\condition_test\FormController.

Class

FormController
Routing controller class for condition_test testing of condition forms.

Namespace

Drupal\condition_test

Code

public function submitForm(array &$form, array &$form_state) {
  $this->condition
    ->submitForm($form, $form_state);
  $config = $this->condition
    ->getConfig();
  $bundles = implode(' and ', $config['bundles']);
  drupal_set_message(t('The bundles are @bundles', array(
    '@bundles' => $bundles,
  )));
  $article = node_load(1);
  $this->condition
    ->setContextValue('node', $article);
  if ($this->condition
    ->execute()) {
    drupal_set_message(t('Executed successfully.'));
  }
}