API:getTemplateVar
From MODx Wiki
API Function Definition:
getTemplateVar
- Versions
- > 0.6.0 ?
- Return Values
- Success: TV values
- Fail: boolean false
- Data Type
- array
- Object Hierarchy
- DocumentParser
array getTemplateVar(string $idname[, string $fields[, int $docid[, int $published]]]);
Returns the template variable specified by $idname for the current page.
Examples
Related Functions
Function Source
| File: | manager/includes/document.parser.inc.php |
|---|---|
| Line: | 1812 |
function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) { if ($idname == "") { return false; } else { $result= $this->getTemplateVars(array ($idname), $fields, $docid, $published, "", ""); //remove sorting for speed return ($result != false) ? $result[0] : false; } }