function ViewsTestDataViewsExecutionHooks::viewsFormSubstitutions

Implements hook_views_form_substitutions().

File

core/modules/views/tests/modules/views_test_data/src/Hook/ViewsTestDataViewsExecutionHooks.php, line 28

Class

ViewsTestDataViewsExecutionHooks
Hook implementations for views_test_data.

Namespace

Drupal\views_test_data\Hook

Code

public function viewsFormSubstitutions() {
    \Drupal::state()->set('views_hook_test_views_form_substitutions', TRUE);
    $render = [
        '#markup' => '<em>unescaped</em>',
    ];
    return [
        '<!--will-be-escaped-->' => '<em>escaped</em>',
        '<!--will-be-not-escaped-->' => \Drupal::service('renderer')->renderInIsolation($render),
    ];
}

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