Skip to content

classmarkets/LipsumGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 is 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.

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);

About

Offline Lorem Ipsum Generator for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages