modChunk.process
Last updated not available | 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 moremodChunk::process¶
Renders the Chunk and returns the output.
-
modElement::processmerges the given properties over the stored defaults and property sets, applies the input filter and loads the content. - The parser walks the body for
[[...]]tags; every property is available as a[[+key]]placeholder. The walk repeats up toparser_max_iterationstimes, 10 by default. - The output filter runs.
- A cacheable Chunk's result enters the per-request element cache; a later call with the same tag reuses it.
Syntax¶
string process ([array|string $properties = null, string $content = null])
-
$properties(array|string) Merged over the Chunk's own properties and property sets before rendering, by defaultnull. -
$content(string) Replaces the stored Chunk content for this run; non-string values are ignored, by defaultnull. - Declared in
modChunk(core/src/Revolution/modChunk.php), overridesmodElement::process(core/src/Revolution/modElement.php).
Example¶
$chunk = $modx->getObject('modChunk', ['name' => 'MyChunk']);
$chunk->setContent('<p>Hello, [[+name]]!</p>');
echo $chunk->process([
'name' => 'staff',
]);
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










