This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/drupal/console/templates/module/module.views.inc.twig
2018-11-23 12:29:20 +00:00

41 lines
1.1 KiB
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 use_class %}
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
use Drupal\Core\Render\Markup;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\system\ActionConfigEntityInterface;
{% 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' => [],
];
$data['views']['{{ class_machine_name }}'] = [
'title' => t('{{ title }}'),
'help' => t('{{ description }}'),
'field' => [
'id' => '{{ class_machine_name }}',
],
];
return $data;
}
{% endblock %}