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.