Initial Drupal 11 with DDEV setup
This commit is contained in:
36
vendor/chi-teck/drupal-code-generator/templates/_template/module.twig
vendored
Normal file
36
vendor/chi-teck/drupal-code-generator/templates/_template/module.twig
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Primary module hooks for {{ name }} module.
|
||||
*/
|
||||
{% if create_theme %}
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function {{ machine_name }}_theme(): array {
|
||||
return [
|
||||
'{{ theme_key }}' => [
|
||||
'variables' => ['foo' => NULL],
|
||||
],
|
||||
];
|
||||
}
|
||||
{% endif %}
|
||||
{% if create_preprocess %}
|
||||
|
||||
/**
|
||||
* Prepares variables for {{ template_name }} template.
|
||||
*
|
||||
* Default template: {{ template_name }}.
|
||||
*
|
||||
* @param array $variables
|
||||
* An associative array containing:
|
||||
* - foo: Foo variable description.
|
||||
*/
|
||||
function template_preprocess_{{ theme_key }}(array &$variables): void {
|
||||
$variables['foo'] = 'bar';
|
||||
}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user