You are here

function twigsuggest_preprocess in Twig Template Suggester 8

Implements hook_preprocess() for all templates.

It's a variable themers should be able to rely on. Now from any template we can do things like <img src="{{ base_path ~ directory }}/images/icon.svg" />

File

./twigsuggest.module, line 340
Twig Template Suggester module hook implementations.

Code

function twigsuggest_preprocess(&$variables, $hook) {
  $variables['base_path'] = base_path();
}