public function TokenHandler::getArgumentsFromTokenString in EVA: Entity Views Attachment 8.2
Get view arguments array from string that contains tokens.
Parameters
string $string: The token string defined by the view.
string $type: The token type.
object $object: The object being used for replacement data (typically a node).
Return value
array An array of argument values.
File
- src/
TokenHandler.php, line 52
Class
- TokenHandler
- Token handling service.
Namespace
Drupal\evaCode
public function getArgumentsFromTokenString($string, $type, $object) {
$args = trim($string);
if (empty($args)) {
return [];
}
$args = $this->token
->replace($args, [
$type => $object,
], [
'sanitize' => FALSE,
]);
return explode('/', $args);
}