Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. theme.api.php

function hook_extension

Declare a template file extension to be used with a theme engine.

This hook is used in a theme engine implementation in the format of ENGINE_extension().

Return value

string The file extension the theme engine will recognize.

Related topics

Hooks
Define functions that alter the behavior of Drupal core.
1 function implements hook_extension()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

twig_extension in core/themes/engines/twig/twig.engine
Implements hook_extension().

File

core/lib/Drupal/Core/Render/theme.api.php, line 806

Code

function hook_extension() {
    // Extension for template base names in Twig.
    return '.html.twig';
}
RSS feed
Powered by Drupal