Jump to main content Jump to doc navigation

modX::parseChunk

Parse a chunk using an associative array of replacement variables.

parseChunk simply does a str_replace on the values in the associative array you pass it, so you cannot use Output Filters or other complex placeholder modifiers here. If you require more functionality from the parser, see modX.getChunk instead.

Syntax

API Doc: http://api.modx.com/revolution/2.2/db_core_model_modx_modx.class.html#%5CmodX::parseChunk()

string parseChunk (string $chunkName, array $chunkArr, [string $prefix = '[[+'], [string $suffix = ']]'])

Example

$output = $modx->parseChunk('myChunk',array('name' => 'John'));

See Also