You are here

public static function BigPipeRegressionTestController::currentTime in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController::currentTime()
  2. 9 core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController::currentTime()

#lazy_builder callback; builds <time> markup with current time.

Return value

array

File

core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php, line 40

Class

BigPipeRegressionTestController

Namespace

Drupal\big_pipe_regression_test

Code

public static function currentTime() {
  return [
    '#markup' => '<time datetime="' . date('Y-m-d', time()) . '"></time>',
    '#cache' => [
      'max-age' => 0,
    ],
  ];
}