views.views_execution.inc 635 Bytes
Newer Older
1 2 3 4 5 6 7 8
<?php

/**
 * @file
 * Provides views runtime hooks for views.module.
 */

use Drupal\views\ViewExecutable;
9
use Drupal\views\Plugin\views\PluginBase;
10 11 12 13

/**
 * Implements hook_views_query_substitutions().
 *
14 15 16 17 18
 * Makes the following substitutions:
 * - Current time.
 * - Drupal version.
 * - Special language codes; see
 *   \Drupal\views\Plugin\views\PluginBase::listLanguages().
19 20
 */
function views_views_query_substitutions(ViewExecutable $view) {
21
  $substitutions = [
22
    '***CURRENT_VERSION***' => \Drupal::VERSION,
23
    '***CURRENT_TIME***' => REQUEST_TIME,
24
  ] + PluginBase::queryLanguageSubstitutions();
25 26

  return $substitutions;
27
}