Initial Drupal 11 with DDEV setup
This commit is contained in:
		
							
								
								
									
										37
									
								
								vendor/chi-teck/drupal-code-generator/templates/Service/_route-subscriber/route-subscriber.twig
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								vendor/chi-teck/drupal-code-generator/templates/Service/_route-subscriber/route-subscriber.twig
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
			
		||||
{% import '@lib/di.twig' as di %}
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Drupal\{{ machine_name }}\EventSubscriber;
 | 
			
		||||
 | 
			
		||||
{% apply sort_namespaces %}
 | 
			
		||||
  {% if services %}
 | 
			
		||||
{{ di.use(services) }}
 | 
			
		||||
  {% endif %}
 | 
			
		||||
use Drupal\Core\Routing\RouteSubscriberBase;
 | 
			
		||||
use Symfony\Component\Routing\RouteCollection;
 | 
			
		||||
{% endapply %}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Route subscriber.
 | 
			
		||||
 */
 | 
			
		||||
final class {{ class }} extends RouteSubscriberBase {
 | 
			
		||||
{% if services %}
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Constructs {{ class|article }} object.
 | 
			
		||||
   */
 | 
			
		||||
  public function __construct(
 | 
			
		||||
{{ di.signature(services) }}
 | 
			
		||||
  ) {}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * {@inheritdoc}
 | 
			
		||||
   */
 | 
			
		||||
  protected function alterRoutes(RouteCollection $collection): void {
 | 
			
		||||
    // @see https://www.drupal.org/node/2187643
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										9
									
								
								vendor/chi-teck/drupal-code-generator/templates/Service/_route-subscriber/services.twig
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								vendor/chi-teck/drupal-code-generator/templates/Service/_route-subscriber/services.twig
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
{% import '@lib/di.twig' as di %}
 | 
			
		||||
services:
 | 
			
		||||
  {{ machine_name }}.route_subscriber:
 | 
			
		||||
    class: Drupal\{{ machine_name }}\EventSubscriber\{{ class }}
 | 
			
		||||
{% if services %}
 | 
			
		||||
    arguments: [{{ di.arguments(services) }}]
 | 
			
		||||
{% endif %}
 | 
			
		||||
    tags:
 | 
			
		||||
      - { name: event_subscriber }
 | 
			
		||||
		Reference in New Issue
	
	Block a user