Function __global->do_notification_template
Definitions
sources/notifications.php
- Wraps do_template, keeping a record of the last call. You can use when building the notification $message.This allows notification handlers to possibly repeat the call with a customised template.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $codename | ID_TEXT | No | No | required parameter | N/A | N/A | The codename of the template being loaded |
| $parameters | array | No | No | [] | N/A | N/A | A map of parameters for the template (key to value); you can have any number of parameters of any name, there is no set standard; having a _GUID parameter of random value is a convention |
| $lang | ?LANGUAGE_NAME | No | No | Null | N/A | N/A | The language to load the template in (templates can embed language references) (null: users own language) |
| $light_error | boolean | No | No | False | N/A | N/A | Whether to produce a light error; not supported so use false |
| $fallback | ?ID_TEXT | No | No | Null | N/A | N/A | The template to use as a fallback; not supported so use null (null: none) |
| $suffix | string | No | No | .tpl | .tpl .js .xml .txt .css | N/A | File type suffix of template file (e.g. .tpl) |
| $directory | string | No | No | templates | templates javascript xml text css | N/A | Subdirectory type to look in |
| $theme | ?ID_TEXT | No | No | Null | N/A | N/A | Theme to use (null: current theme) |
Returns
- The Tempcode for this template
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Wraps do_template, keeping a record of the last call. You can use when building the notification $message.This allows notification handlers to possibly repeat the call with a customised template.
*
* @param ID_TEXT $codename The codename of the template being loaded
* @param array $parameters A map of parameters for the template (key to value); you can have any number of parameters of any name, there is no set standard; having a _GUID parameter of random value is a convention
* @param ?LANGUAGE_NAME $lang The language to load the template in (templates can embed language references) (null: users own language)
* @param boolean $light_error Whether to produce a light error; not supported so use false
* @param ?ID_TEXT $fallback The template to use as a fallback; not supported so use null (null: none)
* @param string $suffix File type suffix of template file (e.g. .tpl)
* @set .tpl .js .xml .txt .css
* @param string $directory Subdirectory type to look in
* @set templates javascript xml text css
* @param ?ID_TEXT $theme Theme to use (null: current theme)
* @return Tempcode The Tempcode for this template
*/
function do_notification_template(string $codename, array $parameters = [], ?string $lang = null, bool $light_error = false, ?string $fallback = null, string $suffix = '.tpl', string $directory = 'templates', ?string $theme = null) : object
* Wraps do_template, keeping a record of the last call. You can use when building the notification $message.This allows notification handlers to possibly repeat the call with a customised template.
*
* @param ID_TEXT $codename The codename of the template being loaded
* @param array $parameters A map of parameters for the template (key to value); you can have any number of parameters of any name, there is no set standard; having a _GUID parameter of random value is a convention
* @param ?LANGUAGE_NAME $lang The language to load the template in (templates can embed language references) (null: users own language)
* @param boolean $light_error Whether to produce a light error; not supported so use false
* @param ?ID_TEXT $fallback The template to use as a fallback; not supported so use null (null: none)
* @param string $suffix File type suffix of template file (e.g. .tpl)
* @set .tpl .js .xml .txt .css
* @param string $directory Subdirectory type to look in
* @set templates javascript xml text css
* @param ?ID_TEXT $theme Theme to use (null: current theme)
* @return Tempcode The Tempcode for this template
*/
function do_notification_template(string $codename, array $parameters = [], ?string $lang = null, bool $light_error = false, ?string $fallback = null, string $suffix = '.tpl', string $directory = 'templates', ?string $theme = null) : object

