You are here

public function BlockEventVariables::getContentChild in Hook Event Dispatcher 8

Get the content for a given child.

Parameters

string $childName: Name of the child.

Return value

array Content of the child or [].

File

src/Event/Preprocess/Variables/BlockEventVariables.php, line 39

Class

BlockEventVariables
Class BlockEventVariables.

Namespace

Drupal\hook_event_dispatcher\Event\Preprocess\Variables

Code

public function getContentChild($childName) {
  if (isset($this->variables['content'][$childName])) {
    return $this->variables['content'][$childName];
  }
  return [];
}