Search

I want to write some PHP logic which has access to the XML from datasources data but occurs before output begins on the page. I’m quite sure this can be done with a custom extension attaching to FrontendPreRenderHeaders or similar —- but is something like this possible from a custom event? The logic is minor and creating an extension just for a few lines of code seems overkill.

I found this post, but it must be quite outdated by now, which is why I’m asking again. Thanks.

Nope, events fire first then DS. You’ll want a delegate, and you subscribe to those in an extension.driver.php. Take a look at my beta HTML5 extension on github to see how few lines of code you need - no more/less than an event.

Yeah you’re right Nick, it’s not that different really. Cheers.

Was on my iPhone earlier and was a faff, but for reference here’s an example of a most basic Extension which subscribes to a single delegate.

http://github.com/nickdunn/html5_doctype/blob/master/extension.driver.php

Firebug Profiler might be useful to you, since it parses the page XML once it has been built.

Create an account or sign in to comment.

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