PicoraTextile
Generate HTML from Textile formatted text.
This class is a thin wrapper around the TextilePHP library which is an implementation of Dean Allen's Textile language.
PicoraTextile::format('some text');
Method Overview
Return | Visibility | Name | Parameters |
string | static public | format | (string $text) |
Method Detail
static public format()
Parameter Type | Name | Description |
string | $text | Textile formatted text. |
This class triggers the following events, which you can observe with the following syntax:
PicoraEvent::observe('event_name','my_function'); //or
PicoraEvent::observe('event_name',array($my_object,'my_instance_method')); //or
PicoraEvent::observe('event_name',array('MyClass','my_static_method'));
Return | Name | Signature | Description |
void | PicoraTextile.beforeFormat | (string text) | |
void | PicoraTextile.afterFormat | (string text) |
Declared in: PicoraTextile.php
class PicoraTextile {
/**
* @param string $text Textile formatted text.
* @return string HTML
*/
static public function format($text){
static $textile;
if(!isset($textile))
$textile = new Textile;
foreach(PicoraEvent::getObserverList('PicoraTextile.beforeFormat') as $callback)
call_user_func($callback,$text);
$output = $textile->process($text);
foreach(PicoraEvent::getObserverList('PicoraTextile.afterFormat') as $callback)
call_user_func($callback,$output);
return $output;
}
}