API:getTemplateVar

From MODx Wiki
Jump to: navigation, search
 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
  1. function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) {
  2. if ($idname == "") {
  3. return false;
  4. } else {
  5. $result= $this->getTemplateVars(array ($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
  6. return ($result != false) ? $result[0] : false;
  7. }
  8. }

Notes

Personal tools