Source of file MockHTMLTextField.php
Size: 0,677 Bytes - Last Modified: 2021-12-23T10:56:24+00:00
/var/www/docs.ssmods.com/process/src/code/fieldtypes/MockHTMLTextField.php
123456789101112131415161718192021222324252627282930313233343536 | <?php /** * Defines the methods that are injected into the {@link HTMLText} class for * generating mock data * * @package silverstripe-mock-data * @author Uncle Cheese <unclecheese@leftandmain.com> */ use Faker\Generator; class MockHTMLTextField extends DataExtension { /** * Gets a random set of paragraphs * * @param Faker\Generator * @return string */ public function getFakeData(Generator $faker) { $paragraphs = rand(1, 5); $i = 0; $ret = ""; while ($i < $paragraphs) { $ret .= "<p>".$faker->paragraph(rand(2, 6))."</p>"; $i++; } return $ret; } } |