You are here

public static function MaestroTemplateFormBase::exists in Maestro 8.2

Same name and namespace in other branches
  1. 3.x src/Form/MaestroTemplateFormBase.php \Drupal\maestro\Form\MaestroTemplateFormBase::exists()

Internal method callback to determine if a template already exists.

File

src/Form/MaestroTemplateFormBase.php, line 362

Class

MaestroTemplateFormBase
Class MaestroTemplateFormBase.

Namespace

Drupal\maestro\Form

Code

public static function exists($submitted_value, array $element, FormStateInterface $form_state) {
  $templates = MaestroEngine::getTemplates();
  if (array_key_exists($submitted_value, $templates)) {
    return TRUE;
  }
  return FALSE;
}