function public static function Element::create
8.x-3.x Element.php | public static Element::create(&$element = [], FormStateInterface $form_state = NULL) |
Creates a new \Drupal\bootstrap\Utility\Element instance.
Parameters
array|string $element: A render array element or a string.
\Drupal\Core\Form\FormStateInterface $form_state: A current FormState instance, if any.
Return value
\Drupal\bootstrap\Utility\Element The newly created element instance.
Class
- Element
- Provides helper methods for Drupal render elements.
Namespace
Drupal\bootstrap\UtilitySource src/Utility/Element.php (line 278)
public static function create(&$element = [], FormStateInterface $form_state = NULL) {
return $element instanceof self ? $element : new self($element, $form_state);
}