You are here

function eva_get_arguments_from_token_string in EVA: Entity Views Attachment 7

Same name and namespace in other branches
  1. 8 eva.module \eva_get_arguments_from_token_string()

Get view arguments array from string that contains tokens

@todo: security?

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.

1 call to eva_get_arguments_from_token_string()
_eva_build_extra_fields in ./eva.module
Adds the EVA to the build, which is either the rendered entity or the form.

File

./eva.module, line 300

Code

function eva_get_arguments_from_token_string($string, $type, $object) {
  $args = trim($string);
  if (empty($args)) {
    return array();
  }
  $args = token_replace($args, array(
    $type => $object,
  ), array(
    'sanitize' => FALSE,
    'clear' => TRUE,
  ));
  return explode('/', $args);
}