modX.parseChunk
Last updated Oct 14th, 2026 | 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 moremodX::parseChunk¶
Parse a chunk using an associative array of replacement variables.
Deprecated since 3.0, to be removed in MODX 4.0 — use $modx->getChunk() instead. Every call writes a deprecation record to the log.
parseChunk runs a plain str_replace on the values you pass, so output filters and other complex placeholder modifiers do not work here.
Syntax¶
string parseChunk (string $chunkName, array $chunkArr, [string $prefix = '[[+'], [string $suffix = ']]'])
Example¶
$output = $modx->parseChunk('myChunk',array('name' => 'John'));
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










