views.views_execution.inc

Same filename and directory in other branches
  1. 9 core/modules/views/views.views_execution.inc
  2. 8.9.x core/modules/views/views.views_execution.inc
  3. 10 core/modules/views/views.views_execution.inc

Provides views runtime hooks for views.module.

File

core/modules/views/views.views_execution.inc

View source
<?php


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

/**
 * Implements hook_views_query_substitutions().
 *
 * Makes the following substitutions:
 * - Current time.
 * - Drupal version.
 * - Special language codes; see
 *   \Drupal\views\Plugin\views\PluginBase::listLanguages().
 */
function views_views_query_substitutions(ViewExecutable $view) {
    $substitutions = [
        '***CURRENT_VERSION***' => \Drupal::VERSION,
        '***CURRENT_TIME***' => \Drupal::time()->getRequestTime(),
    ] + PluginBase::queryLanguageSubstitutions();
    return $substitutions;
}

/**
 * Implements hook_views_form_substitutions().
 */
function views_views_form_substitutions() {
    $select_all = [
        '#type' => 'checkbox',
        '#default_value' => FALSE,
        '#attributes' => [
            'class' => [
                'action-table-select-all',
            ],
        ],
    ];
    return [
        '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
    ];
}

Functions

Title Deprecated Summary
views_views_form_substitutions Implements hook_views_form_substitutions().
views_views_query_substitutions Implements hook_views_query_substitutions().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.