You are here

public function UtilityBase::getBuildForm in SimpleAds 8

File

src/UtilityBase.php, line 50

Class

UtilityBase
Utility ads utility class.

Namespace

Drupal\simpleads

Code

public function getBuildForm(array $form, FormStateInterface $form_state, $type = NULL, $id = NULL) {
  $manager = \Drupal::service($this->manager_name);
  $plugins = $manager
    ->getDefinitions();
  $plugin = $manager
    ->createInstance($plugins[$type]['id']);
  return $plugin
    ->buildForm($form, $form_state, $type, $id);
}