Page XSLTPage FrontendPage

public class FrontendPage extends XSLTPage

class.frontendpage.php #18

The FrontendPage class represents a page of the website that is powered by Symphony. It takes the current URL and resolves it to a page as specified in Symphony which involves deducing the parameters from the URL, ensuring this page is accessible and exists, setting the correct Content-Type for the page and executing any Datasources or Events attached to the page to generate a string of HTML that is returned to the browser. If the resolved page does not exist or the user is not allowed to view it, the appropriate 404/403 page will be shown instead.

Properties

array $_param

An associative array of all the parameters for this page including Symphony parameters, URL Parameters, DS Parameters and Page parameters

Methods

array Env()

Accessor function for the environment variables, aka $this->_env

string Page()

Accessor function for this current page URL, $this->_page

array Params()

Accessor function for the current page params, $this->_param

void __construct()

Constructor function sets the $is_logged_in variable.

string generate(string $page)

This function is called immediately from the Frontend class passing the current URL for generation. Generate will resolve the URL to the specific page in the Symphony and then execute all events and datasources registered to this page so that it can be rendered. A number of delegates are fired during stages of execution for extensions to hook into.

Uses
  • FrontendDevKitResolve
  • FrontendOutputPreGenerate
  • FrontendPreRenderHeaders
  • FrontendOutputPostGenerate
Parameters
  • $page stringThe URL of the current page that is being Rendered as returned by getCurrentPage

Returns

The page source after the XSLT has transformed this page's XML. This would be exactly the same as the 'view-source' from your browser

See Also
array pageData()

Accessor function for the resolved page's data ($this->_pageData) as it lies in tbl_pages

void processDatasources(string $datasources, XMLElement $wrapper, array $params)

Given an array of all the Datasources for this page, sort them into the correct execution order and append the Datasource results to the page XML. If the Datasource provides any parameters, they will be added to the $env pool for use by other Datasources and eventual inclusion into the page parameters.

Parameters
  • $datasources stringA string of Datasource's attached to this page, comma separated.

  • $wrapper XMLElementThe XMLElement to append the Datasource results to. Datasource results are contained in a root XMLElement that is the handlised version of their name.

  • $params arrayAny params to automatically add to the $env pool, by default this is an empty array. It looks like Symphony does not utilise this parameter at all

array resolvePage(string $page)

This function attempts to resolve the given page in to it's Symphony page. If no page is given, it is assumed the 'index' is being requested. Before a page row is returned, it is checked to see that if it has the 'admin' type, that the requesting user is authenticated as a Symphony author. If they are not, the Symphony 403 page is returned (whether that be set as a user defined page using the page type of 403, or just returning the Default Symphony 403 error page). Any URL parameters set on the page are added to the $env variable before the function returns an associative array of page details such as Title, Content Type etc.

Uses
  • FrontendPrePageResolve
Parameters
  • $page stringThe URL of the current page that is being Rendered as returned by getCurrentPage(). If no URL is provided, Symphony assumes the Page with the type 'index' is being requested.

Returns

An associative array of page details

See Also
static string sanitizeParameter(string $parameter)

Given a string (expected to be a URL parameter) this function will ensure it is safe to embed in an XML document.

Parameters
  • $parameter stringThe string to sanitize for XML

Returns

The sanitized string

void setEnv(array $env)

Setter function for $this->_env, which takes an associative array of environment information and replaces the existing $this->_env.

Parameters
  • $env arrayAn associative array of new environment values

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