function TestClassAttribute::__invoke

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/router_test_directory/src/Controller/TestClassAttribute.php \Drupal\router_test\Controller\TestClassAttribute::__invoke()

Attributes

#[Route(name: 'invoke')]

File

core/modules/system/tests/modules/router_test_directory/src/Controller/TestClassAttribute.php, line 25

Class

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

Namespace

Drupal\router_test\Controller

Code

public function __invoke() : array {
  return [
    '#markup' => 'Testing __invoke() with a Route attribute on the class',
  ];
}

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