CRM_Core_SmartyPageTrait
Trait for template management.
Shared by CRM_Core_Controller, CRM_Core_Form & CRM_Core_Page
Table of Contents
Properties
- $_template : CRM_Core_Smarty
- Global smarty template
Methods
- addExpectedSmartyVariable() : void
- Add an expected smarty variable to the array.
- addExpectedSmartyVariables() : void
- Add an expected smarty variable to the array.
- append() : mixed
- Appends values to template variables.
- assign() : mixed
- Assign value to name in template.
- assign_by_ref() : mixed
- Assign value to name in template by reference.
- get_template_vars() : array<string|int, mixed>
- Returns an array containing template variables.
- getHookedTemplateFileName() : mixed
- A wrapper for getTemplateFileName.
- getTemplate() : CRM_Core_Smarty
- getTemplateVars() : mixed
- Get the value/s assigned to the Template Engine (Smarty).
- overrideExtraTemplateFileName() : string
- Default extra tpl file basically just replaces .tpl with .extra.tpl.
Properties
$_template
Global smarty template
protected
static CRM_Core_Smarty
$_template
Tags
Methods
addExpectedSmartyVariable()
Add an expected smarty variable to the array.
public
addExpectedSmartyVariable(string $elementName) : void
Parameters
- $elementName : string
addExpectedSmartyVariables()
Add an expected smarty variable to the array.
public
addExpectedSmartyVariables(array<string|int, mixed> $elementNames) : void
Parameters
- $elementNames : array<string|int, mixed>
append()
Appends values to template variables.
public
append(array<string|int, mixed>|string $tpl_var[, mixed $value = null ][, bool $merge = false ]) : mixed
Parameters
- $tpl_var : array<string|int, mixed>|string
-
the template variable name(s)
- $value : mixed = null
-
The value to append.
- $merge : bool = false
assign()
Assign value to name in template.
public
assign(string $var[, mixed $value = null ]) : mixed
Parameters
- $var : string
-
Name of variable.
- $value : mixed = null
-
Value of variable.
assign_by_ref()
Assign value to name in template by reference.
public
assign_by_ref(string $var, mixed &$value) : mixed
since 5.72 will be removed around 5.84
Parameters
- $var : string
-
Name of variable.
- $value : mixed
-
Value of variable.
get_template_vars()
Returns an array containing template variables.
public
get_template_vars([string $name = null ]) : array<string|int, mixed>
since 5.69 will be removed around 5.93. use getTemplateVars.
Parameters
- $name : string = null
Return values
array<string|int, mixed>getHookedTemplateFileName()
A wrapper for getTemplateFileName.
public
getHookedTemplateFileName() : mixed
This includes calling the hook to prevent us from having to copy & paste the logic of calling the hook.
getTemplate()
public
static getTemplate() : CRM_Core_Smarty
Return values
CRM_Core_SmartygetTemplateVars()
Get the value/s assigned to the Template Engine (Smarty).
public
getTemplateVars([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
overrideExtraTemplateFileName()
Default extra tpl file basically just replaces .tpl with .extra.tpl.
public
overrideExtraTemplateFileName() : string
i.e. we do not override.