Documentation

Template
in package

Table of Contents

Constants

CONSTRUCTION_DEPEND_PATTERN  : mixed = '/{{depend\s*(.*?)}}(.*?){{\/depend\s*}}/si'
Cunstruction logic regular expression
CONSTRUCTION_IF_PATTERN  : mixed = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\/if\s*}...
CONSTRUCTION_PATTERN  : mixed = '/{{([a-z]{0,10})(.*?)}}/si'
Cunstruction regular expression

Properties

$_includeProcessor  : callable|null
Include processor
$_templateProcessor  : callable|null
Template processor
$_templateVars  : array<string|int, mixed>
Assigned template variables

Methods

dependDirective()  : string
filter()  : string
Filter the string as template.
getIncludeProcessor()  : callable|null
Sets the proccessor of includes.
getTemplateProcessor()  : callable|null
Sets the proccessor of templates.
ifDirective()  : string
includeDirective()  : mixed
setIncludeProcessor()  : static
Sets the proccessor of includes.
setTemplateProcessor()  : static
Sets the proccessor of templates. Templates are directives that include email templates based on system configuration path.
setVariables()  : static
Sets template variables that's can be called through {var ...} statement
templateDirective()  : mixed|string
This directive allows email templates to be included inside other email templates using the following syntax: {{template config_path="<PATH>"}}, where <PATH> equals the XPATH to the system configuration value that contains the value of the email template. For example "sales_email/order/template", which is stored in the Mage_Sales_Model_Order::sales_email/order/template. This directive is useful to include things like a global header/footer.
varDirective()  : mixed
_getIncludeParameters()  : array<string|int, mixed>
Return associative array of include construction.
_getVariable()  : string
Return variable value for var construction
getEmailPathValidator()  : Mage_Adminhtml_Model_Email_PathValidator
Retrieve model object
replaceDirectives()  : string
Replace each match of $pattern in $value with the result of $callback.

Constants

CONSTRUCTION_DEPEND_PATTERN

Cunstruction logic regular expression

public mixed CONSTRUCTION_DEPEND_PATTERN = '/{{depend\s*(.*?)}}(.*?){{\/depend\s*}}/si'

CONSTRUCTION_IF_PATTERN

public mixed CONSTRUCTION_IF_PATTERN = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\/if\s*}}/si'

CONSTRUCTION_PATTERN

Cunstruction regular expression

public mixed CONSTRUCTION_PATTERN = '/{{([a-z]{0,10})(.*?)}}/si'

Properties

$_includeProcessor

Include processor

protected callable|null $_includeProcessor = null

$_templateProcessor

Template processor

protected callable|null $_templateProcessor = null

$_templateVars

Assigned template variables

protected array<string|int, mixed> $_templateVars = []

Methods

dependDirective()

public dependDirective(array<string|int, mixed> $construction) : string
Parameters
$construction : array<string|int, mixed>
Return values
string

filter()

Filter the string as template.

public filter(string $value) : string
Parameters
$value : string
Return values
string

getIncludeProcessor()

Sets the proccessor of includes.

public getIncludeProcessor() : callable|null
Return values
callable|null

getTemplateProcessor()

Sets the proccessor of templates.

public getTemplateProcessor() : callable|null
Return values
callable|null

ifDirective()

public ifDirective(array<string|int, mixed> $construction) : string
Parameters
$construction : array<string|int, mixed>
Return values
string

includeDirective()

public includeDirective(mixed $construction) : mixed
Parameters
$construction : mixed

setIncludeProcessor()

Sets the proccessor of includes.

public setIncludeProcessor(callable $callback) : static
Parameters
$callback : callable

it must return string

Return values
static

setTemplateProcessor()

Sets the proccessor of templates. Templates are directives that include email templates based on system configuration path.

public setTemplateProcessor(callable $callback) : static
Parameters
$callback : callable

it must return string

Return values
static

setVariables()

Sets template variables that's can be called through {var ...} statement

public setVariables(array<string|int, mixed> $variables) : static
Parameters
$variables : array<string|int, mixed>
Return values
static

templateDirective()

This directive allows email templates to be included inside other email templates using the following syntax: {{template config_path="<PATH>"}}, where <PATH> equals the XPATH to the system configuration value that contains the value of the email template. For example "sales_email/order/template", which is stored in the Mage_Sales_Model_Order::sales_email/order/template. This directive is useful to include things like a global header/footer.

public templateDirective(mixed $construction) : mixed|string
Parameters
$construction : mixed
Return values
mixed|string

varDirective()

public varDirective(mixed $construction) : mixed
Parameters
$construction : mixed

_getIncludeParameters()

Return associative array of include construction.

protected _getIncludeParameters(string $value) : array<string|int, mixed>
Parameters
$value : string

raw parameters

Return values
array<string|int, mixed>

_getVariable()

Return variable value for var construction

protected _getVariable(string $value[, string|null $default = '{no_value_defined}' ]) : string
Parameters
$value : string

raw parameters

$default : string|null = '{no_value_defined}'

default value

Return values
string

replaceDirectives()

Replace each match of $pattern in $value with the result of $callback.

protected replaceDirectives(string $pattern, string $value, callable $callback) : string

The scan runs one time over $value. A directive result is never scanned again, so a variable value that contains directive text stays literal text.

Parameters
$pattern : string
$value : string
$callback : callable
Return values
string
On this page

Search results