lorem/ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillu...

0.9.3 2017-12-29 05:42 UTC

README

Install

composer require lorem/ipsum

Usage

<?php

include ('vendor/autoload.php');

$loremIpsum = new \Lorem\Ipsum\Generator();
$loremIpsum->addParagraph(2)
    ->addParagraph(8)
    ->wrapAll('article', array('class'=>'lorem-ipsum'))
    ->wrapParagraph(1, 'h1')
    ->wrapParagraph(2, 'p', array('class'=>'lorem-ipsum'))
    ->wrapWord(2, 6, 'span')
    ->wrapWords(2, 1, 3, 'a', array('href'=>'https://packagist.org/packages/lorem/ipsum'));
echo $loremIpsum;

Result

<article class="lorem-ipsum">
<h1>Lorem ipsum</h1>
<p class="lorem-ipsum"><a href="https://packagist.org/packages/lorem/ipsum">Lorem ipsum dolor</a> sit amet, <span>consectetur</span> adipiscing elit</p>
</article>

Usage with your text

<?php

include ('vendor/autoload.php');

class MyLoremIpsum extends \Lorem\Ipsum\Generator
{
    protected $default = 'My text';
}

$loremIpsum = new MyLoremIpsum();