first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
{% import '@lib/di.twig' as di %}
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }}\Controller;
{% apply sort_namespaces %}
use Drupal\Core\Controller\ControllerBase;
{% if services %}
use Symfony\Component\DependencyInjection\ContainerInterface;
{{ di.use(services) }}
{% endif %}
{% endapply %}
/**
* Returns responses for {{ name }} routes.
*/
final class {{ class }} extends ControllerBase {
{% if services %}
/**
* The controller constructor.
*/
public function __construct(
{{ di.signature(services, true) }}
) {}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container): self {
return new self(
{{ di.container(services) }}
);
}
{% endif %}
/**
* Builds the response.
*/
public function __invoke(): array {
$build['content'] = [
'#type' => 'item',
'#markup' => $this->t('It works!'),
];
return $build;
}
}

View File

@@ -0,0 +1,7 @@
{{ route_name }}:
path: '{{ route_path }}'
defaults:
_title: '{{ route_title }}'
_controller: '\Drupal\{{ machine_name }}\Controller\{{ class }}'
requirements:
_permission: '{{ route_permission }}'