annotate vendor/chi-teck/drupal-code-generator/templates/d8/template-module.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /**
Chris@0 4 * @file
Chris@0 5 * Primary module hooks for {{ name }} module.
Chris@0 6 */
Chris@0 7 {% if create_theme %}
Chris@0 8
Chris@0 9 /**
Chris@0 10 * Implements hook_theme().
Chris@0 11 */
Chris@0 12 function {{ machine_name }}_theme() {
Chris@0 13 return [
Chris@0 14 '{{ template_name|h2u }}' => [
Chris@0 15 'variables' => ['foo' => NULL],
Chris@0 16 ],
Chris@0 17 ];
Chris@0 18 }
Chris@0 19 {% endif %}
Chris@0 20 {% if create_preprocess %}
Chris@0 21
Chris@0 22 /**
Chris@0 23 * Prepares variables for {{ template_name }} template.
Chris@0 24 *
Chris@0 25 * Default template: {{ template_name }}.html.twig.
Chris@0 26 *
Chris@0 27 * @param array $variables
Chris@0 28 * An associative array containing:
Chris@0 29 * - foo: Foo variable description.
Chris@0 30 */
Chris@0 31 function template_preprocess_{{ template_name|h2u }}(array &$variables) {
Chris@0 32 $variables['foo'] = 'bar';
Chris@0 33 }
Chris@0 34 {% endif %}