![]() |
|
sfXSLTViewPlugin - 0.1.1symfony xslt view plugin |
|
This plugin is now being used in 3 client sites by [http://www.whiteoctober.co.uk] and is now in a more stable state.
Please use this forum post to ask questions: http://www.symfony-project.org/forum/index.php/t/8506/
It now offers support for components.
If you have set components up they are avaliable by selecting /XML/components/componentname in XSLt.
<xsl:value-of select="/XML/components/crumb" disable-output-escaping="yes"/>
The plugin also supports xsltCache which is a plugin developed by the NY Times [http://code.nytimes.com/projects/xslcache]
You assign variables in the same way you do normally using symfony. It uses the names of these variables as the node names. These are case sensitive.
It also senses if the object has a toArray method and creates a multi dimensional array based on this.
If you pass an array which keys are numeric is persumes that these are multiples of the parent node.
$this->sheeps = array("bah", "bahhh", "bahhh", "mooo");
<sheeps>
<sheep>bah</sheep>
<sheep>bahhh</sheep>
<sheep>bahhh</sheep>
<sheep>mooo</sheep>
</sheeps>
In the example files the "Success" template is looking for the layout.xsl file in the same directory. In all of our applications we put in in the "normal" layout directory.
So to include a layout.xsl which is in your apps/application/template folder from your apps/application/modules/amodule/template/indexSuccess.xsl you need this at the top:
<xsl:include href="../../../templates/layout.xsl"/>
symfony plugin-install http://plugins.symfony-project.com/sfXLTViewPlugin
Create a module.yml either in your project config directory or in your apps config directory that contains the following:
all:
view_class: sfXSLT
You may have problems with default symfony templates. Currently only the 404 template exists. You can add your own if you wish.