W3cubDocs

/Drupal 8

function hook_extension

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.

File

core/lib/Drupal/Core/Render/theme.api.php, line 758
Hooks and documentation related to the theme and render system.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_extension/8.1.x