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,54 @@
{% import '@lib/di.twig' as di %}
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }};
{% apply sort_namespaces %}
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
{% if services %}
{{ di.use(services) }}
{% endif %}
{% endapply %}
/**
* @todo Add description for this breadcrumb builder.
*/
final class {{ class }} implements BreadcrumbBuilderInterface {
use StringTranslationTrait;
{% if services %}
/**
* Constructs {{ class|article }} object.
*/
public function __construct(
{{ di.signature(services) }}
) {}
{% endif %}
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match): bool {
return $route_match->getRouteName() === 'example';
}
/**
* {@inheritdoc}
*/
public function build(RouteMatchInterface $route_match): Breadcrumb {
$breadcrumb = new Breadcrumb();
$links[] = Link::createFromRoute($this->t('Home'), '<front>');
$links[] = Link::createFromRoute($this->t('Example'), '<none>');
return $breadcrumb->setLinks($links);
}
}

View File

@ -0,0 +1,11 @@
{% import '@lib/di.twig' as di %}
services:
{{ machine_name }}.breadcrumb:
class: Drupal\{{ machine_name }}\{{ class }}
{% if services %}
arguments: [{{ di.arguments(services) }}]
{% endif %}
tags:
# In order to override breadcrumbs built with PathBasedBreadcrumbBuilder
# set the priority higher than zero.
- { name: breadcrumb_builder, priority: 1000 }