X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fmodule%2Fcontent-entity%2Fmodel.module.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fmodule%2Fcontent-entity%2Fmodel.module.twig;h=8b3ffa9e9b22f88777aee4e67d04e317fda02c2d;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig new file mode 100644 index 000000000..8b3ffa9e9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig @@ -0,0 +1,36 @@ + [ + 'render element' => 'elements', + ], + ]; +} + +/** + * Prepares variables for {{ entity_type_label|lower }} templates. + * + * Default template: {{ template_name }}. + * + * @param array $variables + * An associative array containing: + * - elements: An associative array containing the {{ entity_type_label|lower }} information and any + * fields attached to the entity. + * - attributes: HTML attributes for the containing element. + */ +function template_preprocess_{{ entity_type_id }}(array &$variables) { + foreach (Element::children($variables['elements']) as $key) { + $variables['content'][$key] = $variables['elements'][$key]; + } +}