You are here

protected function YamlFormHandlerAddForm::prepareYamlFormHandler in YAML Form 8

File

src/Form/YamlFormHandlerAddForm.php, line 53

Class

YamlFormHandlerAddForm
Provides an add form for form handler.

Namespace

Drupal\yamlform\Form

Code

protected function prepareYamlFormHandler($yamlform_handler) {
  $yamlform_handler = $this->yamlformHandlerManager
    ->createInstance($yamlform_handler);

  // Initialize the handler an pass in the form.
  $yamlform_handler
    ->init($this->yamlform);

  // Set the initial weight so this handler comes last.
  $yamlform_handler
    ->setWeight(count($this->yamlform
    ->getHandlers()));
  return $yamlform_handler;
}