Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 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;
}
}