Framework
3.9
|
APITemplate provides a simple template mechanism for transforming APIHelper output to meet 3rd-party standards. More...
Public Member Functions | |
__construct ($file, $mimeType="text/xml") | |
Creates a new APITemplate. More... | |
format ($items) | |
Override this function to provide your format definition. More... | |
Public Member Functions inherited from APIFormatter | |
getClass () | |
Public Attributes | |
$file | |
$mimeType | |
Public Attributes inherited from APIFormatter | |
$parent | |
APITemplate provides a simple template mechanism for transforming APIHelper output to meet 3rd-party standards.
The format is simple. {classname} starts the substitution block {/classname} ends the substitution block (where classname is the name of the DataItemClass. Within the substitution block all DataItem::format() behaviors are available, including method and helper function calls.
The MIME type of the output defaults to XML as this is the most common interchange format. However, you can easily override this when creating your template instance.
Definition at line 175 of file api_helper.inc.
APITemplate::__construct | ( | $file, | |
$mimeType = "text/xml" |
|||
) |
Creates a new APITemplate.
string | $file | the full path to the file containing the template* |
string | $mimeType | the MIME type to be returned in the HTTP headers (default MIME type is text/xml) |
Definition at line 186 of file api_helper.inc.
APITemplate::format | ( | $items | ) |
Override this function to provide your format definition.
The results should be sent to the output buffer, via 'echo' or equivalent.
array | $items | the list of DataItems to be formatted |
Reimplemented from APIFormatter.
Definition at line 192 of file api_helper.inc.
APITemplate::$file |
Definition at line 177 of file api_helper.inc.
APITemplate::$mimeType |
Definition at line 178 of file api_helper.inc.