sfXSLTViewPlugin - 0.1.1
symfony xslt view plugin
You are currently browsing
the website for symfony 1
A plugin to provide XSLT as a templating system
|John Wards||lead||ku.oc.rebotcoetihw <<ta>> sdrawj|
Copyright (c) 2007 John Wards White October Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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:
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.