TestClassAttribute.php

Same filename and directory in other branches
  1. main core/modules/system/tests/modules/router_test_directory/src/Controller/TestClassAttribute.php

Namespace

Drupal\router_test\Controller

File

core/modules/system/tests/modules/router_test_directory/src/Controller/TestClassAttribute.php

View source
<?php

declare (strict_types=1);
namespace Drupal\router_test\Controller;

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\Routing\Attribute\Route;

/**
 * Test controller for class-level Route attribute with method-level merging.
 */
class TestClassAttribute extends ControllerBase {
  public function __invoke() : array {
    return [
      '#markup' => 'Testing __invoke() with a Route attribute on the class',
    ];
  }
  public function inherits() : array {
    return [
      '#markup' => 'Inherits class globals',
    ];
  }
  public function overrides() : array {
    return [
      '#markup' => 'Overrides class globals',
    ];
  }

}

Classes

Title Deprecated Summary
TestClassAttribute Test controller for class-level Route attribute with method-level merging.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.