public function TokensDateFilter::replaceTokens in Tokens in Views Filter Criteria 8
Replace tokens in filters.
Parameters
mixed $value: Array of values `min`, `max` and `value` or just value.
Overrides TokenViewsFilterPluginInterface::replaceTokens
File
- src/
Plugin/ views/ filter/ token/ TokensDateFilter.php, line 25
Class
- TokensDateFilter
- Extending if basic date filter to use tokens as value.
Namespace
Drupal\token_views_filter\Plugin\views\filter\tokenCode
public function replaceTokens(&$value) {
$data = [
'view' => $this->view,
];
$value_keys = [
'value',
'min',
'max',
];
foreach ($value_keys as $key) {
if (isset($value[$key])) {
$value[$key] = $this->token
->replace($value[$key], $data, [
'clear' => TRUE,
]);
}
}
}