API:getChunk

From MODx Wiki

Jump to: navigation, search
 API Function Definition: 
getChunk
Versions 
> 0.9.2
Return Values
Success: Output of a given Chunk
Fail: empty string (or false?)
Data Type 
string
Object Hierarchy 
DocumentParser
string getChunk(string $chunkName);


Retrieves a chunk from the database (or cache) given the name of the chunk.

Examples

$chunkOutput = $modx->getChunk("chunkName");
echo $chunkOutput;
Personal tools