OnWebPagePrerender
Last updated Nov 27th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreEvent: OnWebPagePrerender¶
Fires after a Resource is parsed, before it is rendered. Content-Type headers are not sent yet and the output is not flushed.
- Service: 5 - Template Service Events
- Group: System
Event Parameters¶
None.
Example¶
Filter words from the output before it is displayed:
$words = array("snippet", "template"); // words to filter
$output = &$modx->resource->_output; // get a reference to the output
$output = str_replace($words,"<b>[filtered]</b>",$output);
Static Plugins and relative paths. If the Plugin is a static element and includes or requires files by relative paths, it does not run from the original file. Its code executes from the cached copy — for example core/cache/includes/elements/modplugin/7.include.cache.php. See Bug 11129.
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










