public function Random::paragraphs in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Utility/Random.php \Drupal\Component\Utility\Random::paragraphs()
Generate paragraphs separated by double new line.
Parameters
int $paragraph_count:
Return value
string
File
- core/
lib/ Drupal/ Component/ Utility/ Random.php, line 255
Class
- Random
- Defines a utility class for creating random data.
Namespace
Drupal\Component\UtilityCode
public function paragraphs($paragraph_count = 12) {
$output = '';
for ($i = 1; $i <= $paragraph_count; $i++) {
$output .= $this
->sentences(mt_rand(20, 60)) . "\n\n";
}
return $output;
}