function ElementInfoManagerInterface::fromClass

Creates a render object based on the provided class and configuration.

@template T of ElementInterface

Parameters

class-string<T> $class: The class of the render object being instantiated.

array $configuration: An array of configuration relevant to the render object.

Return value

T A fully configured render object.

Throws

\Drupal\Component\Plugin\Exception\PluginException If the render object cannot be created, such as if the class is invalid.

1 method overrides ElementInfoManagerInterface::fromClass()
ElementInfoManager::fromClass in core/lib/Drupal/Core/Render/ElementInfoManager.php
Creates a render object based on the provided class and configuration.

File

core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php, line 106

Class

ElementInfoManagerInterface
Collects available render array element types.

Namespace

Drupal\Core\Render

Code

public function fromClass(string $class, array $configuration = []) : ElementInterface;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.