function Group::toDtcg
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Theme/DesignToken/Group.php \Drupal\Core\Theme\DesignToken\Group::toDtcg()
Exports to the DTCG representation.
Return value
array The DTCG representation.
Overrides DtcgInterface::toDtcg
File
-
core/
lib/ Drupal/ Core/ Theme/ DesignToken/ Group.php, line 93
Class
- Group
- A group: distinguishable by not having a $value property.
Namespace
Drupal\Core\Theme\DesignTokenCode
public function toDtcg() : array {
$data = [];
if ($this->type) {
$data['$type'] = $this->type;
}
if ($this->description) {
$data['$description'] = $this->description
->render();
}
foreach ($this->children as $key => $child) {
$data[$key] = $child->toDtcg();
}
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.