Navigation

Search

loadTemplate

Description

Loads a template file with the name template_name from the current, default, or base theme.

Syntax

bool loadTemplate (string $template_name[, array $style_sheets[, bool $fatal]])



Parameter $template_name

Expected type: String
Description: The name of the template to be loaded. Can be set to false (as a boolean) when only loading stylesheets.



Parameter $style_sheets

Expected type: Array
Description: An array of style sheets to be loaded. Example: array('additional') will cause the file $settings[$sheet_path] . 'additional'. '.css' to be loaded



Parameter $fatal

Expected type: Boolean
Description: Whether or not to die with an error if the template couldn't be loaded (default is true).



Return value

Expected type: Boolean
Description: True on success, false on failure.


Notes

  • Uses the template_include() function to include the file (include as in the PHP function).
  • Detects a wrong default theme directory and tries to work around it.
  • If fatal is true, dies with an error message if the template cannot be found.
View all versions of this function