function ElementInterface::addChild
Adds a child render element.
Parameters
int|string $name: The name of the child. Can also be an integer when the child is a delta.
array|\Drupal\Core\Render\Element\ElementInterface $child: A render array or a render object.
Return value
\Drupal\Core\Render\Element\ElementInterface The added child as a render object.
1 method overrides ElementInterface::addChild()
- RenderElementBase::addChild in core/
lib/ Drupal/ Core/ Render/ Element/ RenderElementBase.php - Adds a child render element.
File
-
core/
lib/ Drupal/ Core/ Render/ Element/ ElementInterface.php, line 119
Class
- ElementInterface
- Provides an interface for render element plugins.
Namespace
Drupal\Core\Render\ElementCode
public function addChild(int|string $name, ElementInterface|array &$child) : ElementInterface;
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.