Template::subscripting - jcobban/Genealogy GitHub Wiki

$template[$id]

Up: class Template

The class Template implements the methods of the interface ArrayAccess so that subscripts are used to reference instances of class TemplateTag in the Document Object Model (DOM).

parameter description
$id a string which is used to search the DOM for a match on the id attribute

This returns null if there is no matching tag in the DOM.

Examples:

    $tag   = $template['id'];
    $template['id']->update($instructions);

Note that at the present time there is no support for assigning a value to a subscript reference.

Next: $template->switchCase($prefix, $value)