You are here

protected function ComponentsInfo::setProtectedNamespace in Components! 8.2

Marks a Twig namespace as protected and saves info about its extension.

Parameters

string $namespace: The protected Twig namespace to save.

array $extensionInfo: Information about the extension that owns the namespace.

1 call to ComponentsInfo::setProtectedNamespace()
ComponentsInfo::findComponentsInfo in src/Template/ComponentsInfo.php
Finds component info from the given extension list.

File

src/Template/ComponentsInfo.php, line 298

Class

ComponentsInfo
Loads info about components defined in themes or modules.

Namespace

Drupal\components\Template

Code

protected function setProtectedNamespace(string $namespace, array $extensionInfo) {
  $this->protectedNamespaces[$namespace] = [
    'name' => $extensionInfo['name'],
    'type' => $extensionInfo['type'],
    'package' => isset($extensionInfo['package']) ? $extensionInfo['package'] : '',
  ];
}