public function TypedDataResolver::getLabelByToken in Chaos Tool Suite (ctools) 8.3
Provides an administrative label for a tokenized relationship.
Parameters
string $token: The token related to a context in the contexts array.
\Drupal\Core\Plugin\Context\ContextInterface[] $contexts: An array of contexts from which to extract our token's label.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup The administrative label of $token.
File
- src/
TypedDataResolver.php, line 188
Class
Namespace
Drupal\ctoolsCode
public function getLabelByToken($token, $contexts) {
// @todo Optimize this by allowing to limit the desired token?
$tokens = $this
->getTokensForContexts($contexts);
if (isset($tokens[$token])) {
return $tokens[$token];
}
}