TestAttributes.php

Same filename and directory in other branches
  1. 11.x core/modules/system/tests/modules/router_test_directory/src/Controller/TestAttributes.php

Namespace

Drupal\router_test\Controller

File

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

View source
<?php

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

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

/**
 * Test controller for method-level Route attributes.
 */
class TestAttributes extends ControllerBase {
  public function attributeMethod() : array {
    return [
      '#markup' => 'Testing method with a Route attribute',
    ];
  }
  public function allProperties() : array {
    return [
      '#markup' => 'Testing route with all properties',
    ];
  }

}

Classes

Title Deprecated Summary
TestAttributes Test controller for method-level Route attributes.

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