views.views_execution.inc 635 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Provides views runtime hooks for views.module.
  5. */
  6. use Drupal\views\ViewExecutable;
  7. use Drupal\views\Plugin\views\PluginBase;
  8. /**
  9. * Implements hook_views_query_substitutions().
  10. *
  11. * Makes the following substitutions:
  12. * - Current time.
  13. * - Drupal version.
  14. * - Special language codes; see
  15. * \Drupal\views\Plugin\views\PluginBase::listLanguages().
  16. */
  17. function views_views_query_substitutions(ViewExecutable $view) {
  18. $substitutions = [
  19. '***CURRENT_VERSION***' => \Drupal::VERSION,
  20. '***CURRENT_TIME***' => REQUEST_TIME,
  21. ] + PluginBase::queryLanguageSubstitutions();
  22. return $substitutions;
  23. }