You are here

KeyAuthTestController.php in Key auth 8

File

tests/key_auth_test/src/Controller/KeyAuthTestController.php
View source
<?php

namespace Drupal\key_auth_test\Controller;

use Drupal\Core\Controller\ControllerBase;

/**
 * Test controller for key authentication.
 */
class KeyAuthTestController extends ControllerBase {

  /**
   * Print the current user's name to the page.
   *
   * @return string
   *   The user name of the current logged in user.
   */
  public function test() {
    $account = $this
      ->currentUser();
    return [
      '#markup' => $account
        ->getAccountName() . ' - ' . round(microtime(TRUE) * 1000),
    ];
  }

}

Classes

Namesort descending Description
KeyAuthTestController Test controller for key authentication.