Source for file Render.php
Documentation is available at Render.php
* Configuration options for this render rule.
* The name of this rule's format.
* The name of this rule's token array elements.
* A reference to the calling Text_Wiki object.
* This is needed so that each rule has access to the same source
* text, token set, URLs, interwiki maps, page names, etc.
* Constructor for this render format or rule.
* @param object &$obj The calling "parent" Text_Wiki object.
function Text_Wiki_Render (&$obj)
// keep a reference to the calling Text_Wiki object
// get the config-key-name for this object,
// strip the Text_Wiki_Render_ part
// split into pieces at the _ mark.
// first part is format, second part is rule.
// is there a format but no rule?
// then this is the "main" render object, with
// pre() and post() methods.
if ($this->format && ! $this->rule &&
isset ($this->wiki->formatConf [$this->format]) &&
is_array($this->wiki->formatConf [$this->format])) {
// this is a format render object
$this->wiki->formatConf [$this->format]
// is there a format and a rule?
if ($this->format && $this->rule &&
isset ($this->wiki->renderConf [$this->format][$this->rule]) &&
is_array($this->wiki->renderConf [$this->format][$this->rule])) {
// this is a rule render object
$this->wiki->renderConf [$this->format][$this->rule]
* Simple method to safely get configuration key values.
* @param string $key The configuration key.
* @param mixed $default If the key does not exist, return this value
* @return mixed The configuration key value (if it exists) or the
* default value (if not).
function getConf ($key, $default = null )
if (isset ($this->conf[$key])) {
return $this->conf[$key];
* Simple method to wrap a configuration in an sprintf() format.
* @param string $key The configuration key.
* @param string $format The sprintf() format string.
* @return mixed The formatted configuration key value (if it exists)
* or null (if it does not).
function formatConf ($format, $key)
if (isset ($this->conf[$key])) {
return sprintf($format, $this->conf[$key]);
Documentation generated on Mon, 11 Mar 2019 14:22:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|