Handy little Lorem Ipsum class

by Naneau

I often need some random filler text when designing an application. Traditionally, designers use lorem ipsum as ‘random’ text. I have written a handy little class for use with the Zend Framework for this, though it should also function on it’s own.

I just wanted to share it with the you, it might come in handy. I’ve put it up for download: Naneau Text Filler, licensed as New BSD. It’s documented, so as long as place it in your library directory you should be able to use it without much difficulty.

1
2
3
4
5
6
7
8
Zend_Loader::loadClass('Naneau_Text_Filler');
//load it
$words = Naneau_Text_Filler::getWords(2);
//2 words
$paragraphs = Naneau_Text_Filler::getParagraphs(6);
//6 paragraphs
$html = Naneau_Text_Filler::getParagraphs(3, true);
//3 paragraphs, wrapped in <p></p>