You are here

public function Element::__construct in Express 8

Element constructor.

Parameters

array|string $element: A render array element.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ArrayObject::__construct

File

themes/contrib/bootstrap/src/Utility/Element.php, line 51
Contains \Drupal\bootstrap\Utility\Element.

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\bootstrap\Utility

Code

public function __construct(&$element = [], FormStateInterface $form_state = NULL) {
  if (!is_array($element)) {
    $element = [
      '#markup' => $element instanceof MarkupInterface ? $element : new FormattableMarkup($element, []),
    ];
  }
  $this->array =& $element;
  $this->formState = $form_state;
}