File: readme.txt

Recommend this page to a friend!
  Classes of Tom Schaefer  >  Flex Lorem  >  readme.txt  >  Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: read me
Class: Flex Lorem
Generate bogus content to test page layouts
Author: By
Last change: replace doc
Date: 9 years ago
Size: 5,162 bytes


Class file image Download

Class Lorem generates html elements containing lorem ipsum snippets.
It has an easy to use plugin interface. So you can write your own sets of snippets.
Class Lorem comes along with an element builder class which is able to create every 
html element and element attribute you need. The element builder is able to setup well-formed
html. It is fully object-oriented.

Class Lorem has a build-in lorem plugin creator, which converts html source intto a lorem plugin class. Look at the example script how it works.
Once you created a plugin, it will automatically recognized and loaded by class Lorem.

e.g. echo lorem::element("div")
	->addAttribute("class", "article");

  <div class="article">

For a quick impression look at the test script. It shows how to handle {lorem.placeholders} 
with html source snippets.

If you want to see it in action I provided an online show case at
Within the site's form you can manipulate css styles and html elements. You can change the values of the 
layout section. Once you click the loremify button you immediately will see the output results at the bottom of the
web page.

e.g. echo lorem::layout('{Lorem.teaser}')


## provided placeholders

## customization examples
Most of the placeholders are customizable. You can change the output result by adding commaseparated values.

e.g. {Lorem.image, 100, 90} => 90px height image (100 always means 100%)

{Lorem.teaser, 1}
{Lorem.teaser, 2}    => different teaser types
{Lorem.teaser, 3}

{Lorem.headline, 1} > h1
{Lorem.headline, 2} > h2
{Lorem.headline, 3} > h3
{Lorem.headline, 4} > h4

{Lorem.para, 1} > p with only a single word
{Lorem.para, 100} > p with 100 words

## creating a plugin

The first parameter of lorem::createPlugin has to be unique plugin name.
When you define a new placeholder you have to choose a unique name for it.
Otherwise the creator will throw an exception.
The placeholder consists of to parts:
- Lorem (Namespace)
- Placeholder (Method)
e.g. Lorem.choco

The second parameter  of lorem::createPlugin expects an array of the form:
array("name" => array("parameter" => array(), "source" => "your html source");

echo lorem::createPlugin("test", array(
	"sugar" => array(
		"parameters" => array(),
		"source" => '<div class="test">
	"choco" => array(
		"parameters" => array(),
		"source" => '<div class="test">

I hope you see how easy lorem can be used.

Best regards
Tom Schaefer

For more information send a message to info at phpclasses dot org.