Function __global->_do_template
Definitions
sources/tempcode_compiler.php
- A template has not been structurally cached, so compile it and store in the cache.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $theme | ID_TEXT | No | No | required parameter | N/A | N/A | The theme the template is in the context of |
| $directory | string | No | No | required parameter | N/A | N/A | Subdirectory type to look in. Surrounded by '/', unlike with $directory parameters to most other functions (performance reasons) |
| $codename | ID_TEXT | No | No | required parameter | N/A | N/A | The codename of the template |
| $_codename | ID_TEXT | No | No | required parameter | N/A | N/A | The actual codename to use for the template in the cache (e.g. foo_mobile) |
| $lang | LANGUAGE_NAME | No | No | required parameter | N/A | N/A | The language the template is in the context of |
| $suffix | string | No | No | required parameter | .tpl .js .xml .txt .css | N/A | File type suffix of template file (e.g. .tpl) |
| $theme_orig | ?ID_TEXT | No | No | Null | N/A | N/A | The theme to cache in (null: main theme) |
| &$parameters | ?array | Yes | No | Null | N/A | N/A | Parameters to hard-code in during compilation (null: no hard-coding) |
| $non_custom_only | boolean | No | No | False | N/A | N/A | Whether we only searched in the default templates |
Returns
- The compiled Tempcode
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* A template has not been structurally cached, so compile it and store in the cache.
*
* @param ID_TEXT $theme The theme the template is in the context of
* @param string $directory Subdirectory type to look in. Surrounded by '/', unlike with $directory parameters to most other functions (performance reasons)
* @param ID_TEXT $codename The codename of the template
* @param ID_TEXT $_codename The actual codename to use for the template in the cache (e.g. foo_mobile)
* @param LANGUAGE_NAME $lang The language the template is in the context of
* @param string $suffix File type suffix of template file (e.g. .tpl)
* @set .tpl .js .xml .txt .css
* @param ?ID_TEXT $theme_orig The theme to cache in (null: main theme)
* @param ?array $parameters Parameters to hard-code in during compilation (null: no hard-coding)
* @param boolean $non_custom_only Whether we only searched in the default templates
* @return Tempcode The compiled Tempcode
*/
function _do_template(string $theme, string $directory, string $codename, string $_codename, string $lang, string $suffix, ?string $theme_orig = null, ?array &$parameters = null, bool $non_custom_only = false) : object
* A template has not been structurally cached, so compile it and store in the cache.
*
* @param ID_TEXT $theme The theme the template is in the context of
* @param string $directory Subdirectory type to look in. Surrounded by '/', unlike with $directory parameters to most other functions (performance reasons)
* @param ID_TEXT $codename The codename of the template
* @param ID_TEXT $_codename The actual codename to use for the template in the cache (e.g. foo_mobile)
* @param LANGUAGE_NAME $lang The language the template is in the context of
* @param string $suffix File type suffix of template file (e.g. .tpl)
* @set .tpl .js .xml .txt .css
* @param ?ID_TEXT $theme_orig The theme to cache in (null: main theme)
* @param ?array $parameters Parameters to hard-code in during compilation (null: no hard-coding)
* @param boolean $non_custom_only Whether we only searched in the default templates
* @return Tempcode The compiled Tempcode
*/
function _do_template(string $theme, string $directory, string $codename, string $_codename, string $lang, string $suffix, ?string $theme_orig = null, ?array &$parameters = null, bool $non_custom_only = false) : object

