2022-04-27 11:30:43 +02:00

31 lines
845 B
Twig

{% extends "base/file.php.twig" %}
{% block file_path %}{{ module }}\{{ module }}.views.inc.{% endblock %}
{% block extra_info %} * Provide a custom views field data that isn't tied to any other module.{% endblock %}
{% block file_methods %}
/**
* Implements hook_views_data().
*/
function {{module}}_views_data() {
$data['views']['table']['group'] = t('Custom Global');
$data['views']['table']['join'] = [
// #global is a special flag which allows a table to appear all the time.
'#global' => [],
];
{% for field in fields %}
$data['views']['{{ field.class_machine_name }}'] = [
'title' => t('{{ field.title }}'),
'help' => t('{{ field.description }}'),
'field' => [
'id' => '{{ field.class_machine_name }}',
],
];
{% endfor %}
return $data;
}
{% endblock %}