class Messaging_Template_Part in Messaging 6.3
Each text part to be rendered independently
Hierarchy
- class \Messaging_Template_Part implements Messaging_Template_Element
Expanded class hierarchy of Messaging_Template_Part
File
- messaging_template/
messaging_template.inc, line 515 - Base classes for messaging templates
View source
class Messaging_Template_Part implements Messaging_Template_Element {
// Part key and default value
public $key;
public $default;
public $text;
// Parent template object
protected $template;
// Constructor
function __construct($template, $key, $default = NULL) {
$this->template = $template;
$this->key = $key;
$this->default = $default;
}
// Get content as string
function get_content($method, $language) {
if (!isset($this->text[$method][$language->language])) {
if ($part = $this->template
->get_part($this->key, NULL, $method, $language)) {
$text = $part->template;
}
else {
$text = isset($this->default) ? $this->default : '';
}
$this->text[$method][$language->language] = $text;
}
return $this->text[$method][$language->language];
}
// This element needs token replacement
function needs_replace() {
return TRUE;
}
// Reset text
function reset($recurse = FALSE) {
$this->text = NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Messaging_Template_Part:: |
public | property | ||
Messaging_Template_Part:: |
public | property | ||
Messaging_Template_Part:: |
protected | property | ||
Messaging_Template_Part:: |
public | property | ||
Messaging_Template_Part:: |
function |
Overrides Messaging_Template_Element:: |
||
Messaging_Template_Part:: |
function |
Overrides Messaging_Template_Element:: |
||
Messaging_Template_Part:: |
function |
Overrides Messaging_Template_Element:: |
||
Messaging_Template_Part:: |
function |