[dokuwiki] Re: events and custom templates

Martin Tschofen wrote:
I'd like to cache/process the entire HTML code that get's spit to the browser.
Perhaps trigger an event just before a custom template runs and right
thereafter with access to the data that was collected. So for example
I could cache or parse the entire <html> structure without
reprocessing it. I can't do that with the existing events, can I?

...martin
You could use DOKUWIKI_STARTED and DOKUWIKI_DONE

In DOKUWIKI_STARTED activate output buffering - ob_start()
In DOKUWIKI_DONE retrieve and terminate output buffering, $output = ob_get_clean();


As the event description for DOKUWIKI_DONE says, some DokuWiki execution paths may result in early script termination without reaching DOKUWIKI_DONE. The ones I know about are concerned with data saving, so probably won't impact on what you are doing.

Cheers,

Chris



--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: