You are here

public static function FormBase::fromArray in Form Builder 7.2

Shortcut for creating a form object from a form array.

File

src/FormBase.php, line 20

Class

FormBase

Namespace

Drupal\form_builder

Code

public static function fromArray($form) {
  $fb = $form['#form_builder'] + array(
    'sid' => NULL,
  );
  return Loader::instance()
    ->getForm($fb['form_type'], $fb['form_id'], $fb['sid'], $form);
}