.. segalanya bermula di sini ..
Posts tagged PEAR
Text_Wiki : getRenderConf()
Dec 16th
void getRenderConf (string format name, string rule name [, string conf key])
Gets the value of a configuration key for a rule rendered in a specific format; if no key is specified, gets the entire configuration array.
$wiki =& new Text_Wiki();
// get the list of pages that the wikilink rule knows about
$dir = $wiki->getRenderConf(’Xhtml’, ‘Wikilink’, ‘pages’);
// get all configs for the “Xhtml” format “wikilink” rule
$conf = $wiki->getRenderConf(’Xhtml’, ‘Wikilink’);
?>
Text_Wiki:MethodGetRenderConf (pmjones)
Thu, 12 Aug 2004, 21:35
Text_Wiki : setRenderConf()
Dec 16th
setRenderConf
Set one key at a time
void setFormatConf (string format name, string rule name, string conf key, mixed conf value)
Set all keys at once
void setFormatConf (string format name, string rule name, array conf key-value pairs)
Set the configuration for a rule renderer. For example, to tell the “Table” rule in “Xhtml” format what CSS class to use for data cells…
$wiki =& new Text_Wiki();
$wiki->setRenderConf(’Xhtml’, ‘Table’, ‘css_td’, ‘my_td_class’);
?>
To set all of the “Table” configuration keys for “Xhtml” at the same time…
$wiki =& new Text_Wiki();
$conf = array(
‘css_table’ => ‘my_table_class’,
‘css_tr’ => ‘my_tr_class’,
‘css_td’ => ‘my_td_class’
);
$wiki->setRenderConf(’Xhtml’, ‘Table’, $conf);
?>
Text_Wiki : getSource()
Dec 16th
getSource
string getSource ()
Gets the value of the $source property; i.e., the source text after all rules have been applied and matching rules have replaced source text with delimited tokens. This is generally useful only after parse() has been called.
// [snip] create a Text_Wiki object called $wiki
// [snip] load some source text into $text
$wiki->parse($text);
$source_with_delimited_tokens = $wiki->getSource();
?>
Text_Wiki : setParseConf()
Dec 16th
setParseConf
Set one key at a time
void setParseConf (string rule name, string conf key, mixed conf value)
Set all keys at once
void setParseConf (string rule name, array conf key-value pairs)
Set the configuration for a rule parser. For example, to tell the “include” rule what base path to use for scripts:
$wiki =& new Text_Wiki();
$wiki->setParseConf(’include’, ‘base’, ‘/path/to/scripts’);
?>
Note: Most rules use “render” configurations, not parse configurations.

