function BigPipeRegressionTestController::currentTime

Same name in other branches
  1. 9 core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController::currentTime()
  2. 8.9.x core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController::currentTime()
  3. 11.x 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 86

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,
        ],
    ];
}

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