Template::getElementById - jcobban/Genealogy GitHub Wiki

$template->getElementById($id)

Up: class Template

This examines the HTML or XML document represented by the template after all of the files identified by calls to includeSub have been inserted into the base template, but before the text substitutions defined by calls to Template::updateTag or TemplateTag::update or Template::set have been applied. The template document is organized into a Document Object Model (DOM). If the method finds a tag whose 'id' attribute matches the specified identifier in the DOM information about the tag is returned as an instance of class TemplateTag. Otherwise the method returns null.

This method has one parameter:

parameter description
$id a string containing the identifier of the tag to be located

This method is modeled on the Javascript method document.getElementById.

A more compact syntax for this is $template[$id].

Next: $template[]