function BigPipeRegressionTestController::renderRandomSentence

Same name and namespace in other branches
  1. 11.x core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController::renderRandomSentence()

Renders a random length sentence.

Parameters

int $length: The sentence length.

Return value

array Render array.

File

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

Class

BigPipeRegressionTestController

Namespace

Drupal\big_pipe_regression_test

Code

public static function renderRandomSentence(int $length) : array {
  return [
    '#cache' => [
      'max-age' => 0,
    ],
    '#markup' => (new Random())->sentences($length),
  ];
}

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