Page XSLTPage

public class XSLTPage extends Page

class.xsltpage.php #11

XSLTPage extends the Page class to provide an object representation of a Page that will be generated using XSLT.

Properties

XsltProcess $Proc

An instance of the XsltProcess class

Methods

void __construct()

The constructor for the XSLTPage ensures that an XSLTProcessor is available, and then sets an instance of it to $this->Proc, otherwise it will throw a SymphonyErrorPage exception.

string generate(null $page)

The generate function calls on the XsltProcess to transform the XML with the given XSLT passing any parameters or functions If no errors occur, the parent generate function is called to add the page headers and a string containing the transformed result is result.

See Also
array getError()

Returns an iterator of errors from the XsltProcess. Use this function inside a loop to get all the errors that occurring when transforming $this->_xml with $this->_xsl.

Returns

An associative array containing the errors details from the XsltProcessor

string|XMLElement getXML()

Accessor for the XML of this page

string getXSL()

Accessor for the XSL of this page

void registerPHPFunction(mixed $function)

Allows the registration of PHP functions to be used on the Frontend by passing the function name or an array of function names

Parameters
  • $function mixedEither an array of function names, or just the function name as a string

void setRuntimeParam(array $param)

Sets the parameters that will output with the resulting page and be accessible in the XSLT. This function translates all ' into ', with the tradeoff being that a that has a ' will output ' but the benefit that ' and " can be in the params

Parameters
  • $param arrayAn associative array of params for this page

See Also
void setXML(string|XMLElement $xml, boolean $isFile)

Setter for $this->_xml, can optionally load the XML from a file.

Parameters
  • $xml string|XMLElementThe XML for this XSLT page

  • $isFile booleanIf set to true, the XML will be loaded from a file. It is false by default

void setXSL(string $xsl, boolean $isFile)

Setter for $this->_xsl, can optionally load the XSLT from a file.

Parameters
  • $xsl stringThe XSLT for this XSLT page

  • $isFile booleanIf set to true, the XSLT will be loaded from a file. It is false by default

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details