You are here

public function ContextFormBase::contextExists in Context 8.4

Same name and namespace in other branches
  1. 8 modules/context_ui/src/Form/ContextFormBase.php \Drupal\context_ui\Form\ContextFormBase::contextExists()
  2. 8.0 modules/context_ui/src/Form/ContextFormBase.php \Drupal\context_ui\Form\ContextFormBase::contextExists()

Check to see if a context already exists with the specified name.

Parameters

string $name: The machine name to check for.

Return value

bool TRUE if context exists. FALSE if context doesn't exist.

File

modules/context_ui/src/Form/ContextFormBase.php, line 292

Class

ContextFormBase
Provides a context form base.

Namespace

Drupal\context_ui\Form

Code

public function contextExists($name) {
  return $this->contextManager
    ->contextExists($name);
}