views.views_execution.inc

Provides views runtime hooks for views.module.

File

drupal/core/modules/views/views.views_execution.inc
View source
<?php

/**
 * @file
 * Provides views runtime hooks for views.module.
 */
use Drupal\Core\Language\Language;
use Drupal\views\ViewExecutable;

/**
 * Implements hook_views_query_substitutions().
 *
 * Substitute current time; this works with cached queries.
 */
function views_views_query_substitutions(ViewExecutable $view) {
  return array(
    '***CURRENT_VERSION***' => VERSION,
    '***CURRENT_TIME***' => REQUEST_TIME,
    '***CURRENT_LANGUAGE***' => language(Language::TYPE_CONTENT)->langcode,
    '***DEFAULT_LANGUAGE***' => language_default()->langcode,
  );
}

Functions