public function CourierTokenElementTrait::templateCollectionTokenElement in Courier 2.x
Same name and namespace in other branches
- 8 src/CourierTokenElementTrait.php \Drupal\courier\CourierTokenElementTrait::templateCollectionTokenElement()
Render a token element for a template collection.
Parameters
\Drupal\courier\TemplateCollectionInterface $template_collection: A template collection entity.
Return value
array A render array.
See also
::courierTokenElement()
2 calls to CourierTokenElementTrait::templateCollectionTokenElement()
- ChannelFormController::tokens in src/
Controller/ ChannelFormController.php - Get tokens for a template collection.
- EmailForm::form in src/
Form/ EmailForm.php - Gets the actual form array to be built.
File
- src/
CourierTokenElementTrait.php, line 26
Class
- CourierTokenElementTrait
- Token trait.
Namespace
Drupal\courierCode
public function templateCollectionTokenElement(TemplateCollectionInterface $template_collection) {
$tokens = ($context = $template_collection
->getContext()) ? $context
->getTokens() : [];
return $this
->courierTokenElement($tokens);
}