.

TextPlaceholders Class Reference

Collects and processes placeholders. More...

List of all members.

Static Public Member Functions

static  add (ITextPlaceholder $placeholder, $to_front=false)
  Add a placeholder to list of placeholders.
static  apply ($text)
  Apply placeholders to given text.

Detailed Description

Collects and processes placeholders.

Author:
Gerd Riesselmann

Definition at line 8 of file textplaceholders.cls.php.


Member Function Documentation

static TextPlaceholders::add ( ITextPlaceholder placeholder,
to_front = false  
) [static]

Add a placeholder to list of placeholders.

ITextPlaceholder $placeholder bool $to_front If true, placehodler is prepended to list, else it is appended

Definition at line 22 of file textplaceholders.cls.php.

00022                                                                                      {
00023                 if ($to_front) {
00024                         array_unshift(self::$placeholders, $placeholder);
00025                 }
00026                 else {
00027                         self::$placeholders[] = $placeholder;
00028                 }
00029         } 
static TextPlaceholders::apply ( text  )  [static]

Apply placeholders to given text.

string $text

Returns:
string

Definition at line 37 of file textplaceholders.cls.php.

00037                                             {
00038                 $ret = $text;
00039                 foreach(self::$placeholders as $placeholder) {
00040                         $ret = $placeholder->apply($ret);
00041                 }
00042                 return $ret;
00043         }

The documentation for this class was generated from the following file: