function TestAttributes::attributeMethod

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

Attributes

#[Route('/test_method_attribute', name: 'router_test.method_attribute', requirements: [ '_access' => 'TRUE', ], alias: 'router_test.alias_test')] #[Route('/test_method_attribute-other-path', name: 'router_test.method_attribute_other', requirements: [ '_access' => 'TRUE', ])]

File

core/modules/system/tests/modules/router_test_directory/src/Controller/TestAttributes.php, line 16

Class

TestAttributes
Test controller for method-level Route attributes.

Namespace

Drupal\router_test\Controller

Code

public function attributeMethod() : array {
  return [
    '#markup' => 'Testing method with a Route attribute',
  ];
}

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