loadTemplate

Description

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

Syntax

mixed loadTemplate (string $template_name[, bool $fatal])



Parameter $template_name

Expected type: String
Description: The name of the template 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: Mixed
Description:

Possible types
Allowed values Description
Void Nothing is returned if the template was loaded successfully.
Boolean False is returned if the template couldn't be loaded and $fatal is false (see notes).


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.
Advertisement: