new FtTemplate - jcobban/Genealogy GitHub Wiki

new FtTemplate($include, $dialog)

Up: class FtTemplate

The constructor implements the common support for template internationalization, including choosing the language-specific base template, and displaying the appropriate apology for lack of a script specific template for a particular language, is consolidated in the constructor for the class FtTemplate. Class FtTemplate, unlike its parent class Template is specific to the genealogy application and understands the file naming conventions used by the application. It takes the following parameters:

parameter description
$include If the FtTemplate constructor is called with a file name “...pagell.html” or “...dialogll.html” it recognizes that this is a master page/dialog template and passes it to the parent class Template. However if this parameter does not match that pattern it is assumed to be the name of the page and language specific template for the current application script. The language code may either be a 2 character ISO 639-1 identifier or a an ISO 639-1 a hyphen and an ISO 3166-1 country code. For example the class supports 'fr', 'de', as well as 'es-MX' and 'fr-CA'. If the requested page and language specific template exists relative to the templates directory it is made the MAIN substitution, otherwise the language code is replaced with “en”, the appropriate apology text from the Languages table is added to $warn, and the modified name is made the MAIN substitution.
$dialog If true the constructor invokes the parent Template constructor with a file name “{$tempBase}dialog$lang.html”. If this parameter is omitted or explicitly false the constructor invokes the parent Template constructor with a file name "{$tempBase}page$lang.html".

Next: $template->includeSub($filename, $submarker, $after)