[piwi] r581 committed - Edited wiki page PiwiGenerators through web user interface.

2 views
Skip to first unread message

pi...@googlecode.com

unread,
Nov 21, 2010, 8:15:26 AM11/21/10
to piwi...@googlegroups.com
Revision: 581
Author: danielpalme82
Date: Sun Nov 21 05:12:47 2010
Log: Edited wiki page PiwiGenerators through web user interface.
http://code.google.com/p/piwi/source/detail?r=581

Modified:
/wiki/PiwiGenerators.wiki

=======================================
--- /wiki/PiwiGenerators.wiki Wed Jan 7 00:30:36 2009
+++ /wiki/PiwiGenerators.wiki Sun Nov 21 05:12:47 2010
@@ -58,6 +58,18 @@
</content>
}}}
At runtime the `Generator` with ID `sampleGenerator` will be instantiated
and its `generate` method will be run. The XML this method returns will be
placed in the output instead of the `<generator>` element.
+
+To use a `Generator` within a template use this code:
+{{{
+<?php
+$content = BeanFactory ::
getBeanById('generatorFactory')->callGenerator('sampleGenerator');
+$processor = new XSLTProcessor();
+$processor->registerPHPFunctions();
+$processor->importStyleSheet(DOMDocument ::
load($GLOBALS['PIWI_ROOT'] . "resources/xslt/GeneratorTransformation.xsl"));
+$content = $processor->transformToXML($content);
+
+echo $content ?>
+}}}

= Implemented Generators =
PIWI comes along with a bunch of implemented `Generators`, which you can
use within your website.

Reply all
Reply to author
Forward
0 new messages