0 users online. Create an account or sign in to join them.Users

Search

I like the Symphony interface as a back-end, but I prefer the power of PHP to XSLT, especially considering I work on a lot of program intensive apps. Is there anyway to expose the XML data that Symphony generates and then let PHP take over?

I was thinking something along the lines of making .xml pages on the server execute PHP and then get PHP to somehow import the XML on the page (that which can be viewed with ?debug) into arrays or something.

Thanks.

It’s not uncommon to see this practise. For example, Flash developers use Symphony as a XML processing and content authoring backend coupled with a Flash-driven front-end. We’ve also seen others use Symphony as a JSON server.

You can simply use Symphony to provide a RESTful interface (making a request via URL and exposing the XML return).

Thanks Allen, I’m glad it’s possible. But I’m not sure how Symphony can be configured to do that?

I think one way you could do this is to create datasources as you would normally do and make the pages in a RESTful manner, but set their page type to be XML so that the data was outputted as XML.

For each of the pages the XSLT then would be a simple <xsl:copy-of select='*' />.

Do you want for those pages to be public xml files or private?

For public xml files, you can easily just make a new page. Go to Blueprints > Pages > and click on the Create New button.

Make your page type XML. Select the DataSources you want to include on that page. Then for the XSL template, you can do something as basic like this which will reflect whatever XML is being generated.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"
    encoding="UTF-8"
    indent="yes" />

<xsl:template match="/">
    <xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet>

For private XML (or secure/hidden xml), I’m not fully sure (since I’ve never done it), but think this would deal with remote login option under your the System > Authors (under the author detail)

Thank you all for the replies. I’ve got it figured out now.

Is there anyway to expose the XML data that Symphony generates and then let PHP take over?

Not in Symphony. The clean separation is strict, so PHP processes and manipulates data first (via Data Sources and Events) and this is provided as XML to the XSLT layer for rendering.

So you might want to use Symphony to create your RESTful URL structure for data access (building your API) but then read these feeds from your own application (which would sit outside of Symphony itself).

If you need to use specific PHP functions on your XML output, you can check out my EXSL Function Manager extension, which lets extensions convert PHP functions into EXSL functions. Might not be exactly what you’re looking for, but its something.

I decided to not release it because it really is the long way round. I couldn’t come up with many sound use-cases.

i’ve definitely done something like this for an all flash site like allen said. just used the urls as if they were normal xml docs no problem. i used xslt to create my xml structure with a RESTful url to get the data i needed/wanted.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details