Offline Lorem Ipsum Generator for PHP
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Classmarkets
.gitignore
.travis.yml
COPYRIGHT
README.md
composer.json
phpunit.xml.dist

README.md

About

Build Status

This is a Lorem ipsum generator written in PHP. It is based on the work of Mathew Tinsley and has been refactored so it can be used as a composer module and to match the PSR codestyle. The original code can be found here, or by looking at the very first commit.

Text generation is based on a fixed dictionary, and randomized using a Gaussian distribution of the word length. Supported output formats are HTML paragraphs (<p/>), preformatted and unformated plain text. Words per paragraph and number of paragraphs can be configured.

Once again, all credits for the implementation go to Mathew Tinsley, unless he stole it, in which case I don't mind taking the credit myself :)

Usage:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/classmarkets/LipsumGenerator"
        }
    ],
    "require": {
        "classmarkets/lipsum-generator": "*"
    }
}
<?php
use Classmarkets\LipsumGenerator;

$wordPerParagraph = 100;
$numberOfParagaphs = 1;

$generator          = new LipsumGenerator($wordsPerParagraph);

$htmlLipsum         = $generator->getContent($numberOfParagraphs, LipsumGenerator::FORMAT_HTML);
$preFormattedLipsum = $generator->getContent($numberOfParagraphs, LipsumGenerator::FORMAT_TEXT);
$plainLipsum        = $generator->getContent($numberOfParagraphs, LipsumGenerator::FORMAT_PLAIN);