class Parser extends SSTemplateParser

Parser that scans through a template and extracts the parameters to the _t and <%t calls

Methods

__construct(string $string, bool $warnIfEmpty = true)

No description

construct($matchrule, $name, $arguments = null)

Override the function that constructs the result arrays to also prepare a 'php' item in the array

setClosedBlocks(array $closedBlocks)

Set the closed blocks that the template parser should use

setOpenBlocks(array $openBlocks)

Set the open blocks that the template parser should use

addClosedBlock(string $name, callable $callable)

Add a closed block callable to allow <% name %><% end_name %> syntax

addOpenBlock(string $name, callable $callable)

Add a closed block callable to allow <% name %> syntax

match_Template($stack = array())

No description

Template_STR($res, $sub)

No description

match_Word($stack = array())

No description

match_NamespacedWord($stack = array())

No description

match_Number($stack = array())

No description

match_Value($stack = array())

No description

match_CallArguments($stack = array())

No description

CallArguments_Argument($res, $sub)

Values are bare words in templates, but strings in PHP. We rely on PHP's type conversion to back-convert strings to numbers when needed.

match_Call($stack = array())

No description

match_LookupStep($stack = array())

No description

match_LastLookupStep($stack = array())

No description

match_Lookup($stack = array())

No description

Lookup__construct($res)

No description

Lookup_AddLookupStep($res, $sub, $method)

The basic generated PHP of LookupStep and LastLookupStep is the same, except that LookupStep calls 'obj' to get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj) depending on the context the lookup is used in.

Lookup_LookupStep($res, $sub)

No description

Lookup_LastLookupStep($res, $sub)

No description

match_Translate($stack = array())

No description

match_InjectionVariables($stack = array())

No description

match_Entity($stack = array())

No description

Translate__construct($res)

No description

Translate_Entity($res, $sub)

No description

Translate_Default($res, $sub)

No description

Translate_Context($res, $sub)

No description

Translate_InjectionVariables($res, $sub)

No description

Translate__finalise($res)

No description

InjectionVariables__construct($res)

No description

InjectionVariables_InjectionName($res, $sub)

No description

InjectionVariables_Argument($res, $sub)

No description

InjectionVariables__finalise($res)

No description

match_SimpleInjection($stack = array())

No description

match_BracketInjection($stack = array())

No description

match_Injection($stack = array())

No description

Injection_STR($res, $sub)

No description

match_DollarMarkedLookup($stack = array())

No description

DollarMarkedLookup_STR($res, $sub)

No description

match_QuotedString($stack = array())

No description

match_FreeString($stack = array())

No description

match_Argument($stack = array())

No description

Argument_DollarMarkedLookup($res, $sub)

If we get a bare value, we don't know enough to determine exactly what php would be the translation, because we don't know if the position of use indicates a lookup or a string argument.

Argument_QuotedString($res, $sub)

No description

Argument_Lookup($res, $sub)

No description

Argument_FreeString($res, $sub)

No description

match_ComparisonOperator($stack = array())

No description

match_Comparison($stack = array())

No description

Comparison_Argument($res, $sub)

No description

Comparison_ComparisonOperator($res, $sub)

No description

match_PresenceCheck($stack = array())

No description

PresenceCheck_Not($res, $sub)

No description

PresenceCheck_Argument($res, $sub)

No description

match_IfArgumentPortion($stack = array())

No description

IfArgumentPortion_STR($res, $sub)

No description

match_BooleanOperator($stack = array())

No description

match_IfArgument($stack = array())

No description

IfArgument_IfArgumentPortion($res, $sub)

No description

IfArgument_BooleanOperator($res, $sub)

No description

match_IfPart($stack = array())

No description

match_ElseIfPart($stack = array())

No description

match_ElsePart($stack = array())

No description

match_If($stack = array())

No description

If_IfPart($res, $sub)

No description

If_ElseIfPart($res, $sub)

No description

If_ElsePart($res, $sub)

No description

match_Require($stack = array())

No description

Require_Call($res, $sub)

No description

match_CacheBlockArgument($stack = array())

No description

CacheBlockArgument_DollarMarkedLookup($res, $sub)

No description

CacheBlockArgument_QuotedString($res, $sub)

No description

CacheBlockArgument_Lookup($res, $sub)

No description

match_CacheBlockArguments($stack = array())

No description

CacheBlockArguments_CacheBlockArgument($res, $sub)

No description

match_CacheBlockTemplate($stack = array())

No description

match_UncachedBlock($stack = array())

No description

UncachedBlock_Template($res, $sub)

No description

match_CacheRestrictedTemplate($stack = array())

No description

CacheRestrictedTemplate_CacheBlock($res, $sub)

No description

CacheRestrictedTemplate_UncachedBlock($res, $sub)

No description

match_CacheBlock($stack = array())

No description

CacheBlock__construct($res)

No description

CacheBlock_CacheBlockArguments($res, $sub)

No description

CacheBlock_Condition($res, $sub)

No description

CacheBlock_CacheBlock($res, $sub)

No description

CacheBlock_UncachedBlock($res, $sub)

No description

CacheBlock_CacheBlockTemplate($res, $sub)

No description

match_OldTPart($stack = array())

No description

match_N($stack = array())

No description

OldTPart__construct($res)

No description

OldTPart_QuotedString($res, $sub)

No description

OldTPart_CallArguments($res, $sub)

No description

OldTPart__finalise($res)

No description

match_OldTTag($stack = array())

No description

OldTTag_OldTPart($res, $sub)

No description

match_OldSprintfTag($stack = array())

No description

OldSprintfTag__construct($res)

No description

OldSprintfTag_OldTPart($res, $sub)

No description

OldSprintfTag_CallArguments($res, $sub)

No description

match_OldI18NTag($stack = array())

No description

OldI18NTag_STR($res, $sub)

No description

match_NamedArgument($stack = array())

No description

NamedArgument_Name($res, $sub)

No description

NamedArgument_Value($res, $sub)

No description

match_Include($stack = array())

No description

Include__construct($res)

No description

Include_Template($res, $sub)

No description

Include_NamedArgument($res, $sub)

No description

Include__finalise($res)

No description

match_BlockArguments($stack = array())

No description

match_NotBlockTag($stack = array())

No description

match_ClosedBlock($stack = array())

No description

ClosedBlock__construct($res)

As mentioned in the parser comment, block handling is kept fairly generic for extensibility. The match rule builds up two important elements in the match result array: 'ArgumentCount' - how many arguments were passed in the opening tag 'Arguments' an array of the Argument match rule result arrays

ClosedBlock_BlockArguments($res, $sub)

No description

ClosedBlock__finalise($res)

No description

ClosedBlock_Handle_Loop($res)

This is an example of a block handler function. This one handles the loop tag.

ClosedBlock_Handle_With($res)

The closed block handler for with blocks

match_OpenBlock($stack = array())

No description

OpenBlock__construct($res)

No description

OpenBlock_BlockArguments($res, $sub)

No description

OpenBlock__finalise($res)

No description

OpenBlock_Handle_Debug($res)

This is an open block handler, for the <% debug %> utility tag

OpenBlock_Handle_Base_tag($res)

This is an open block handler, for the <% base_tag %> tag

OpenBlock_Handle_Current_page($res)

This is an open block handler, for the <% current_page %> tag

match_MismatchedEndBlock($stack = array())

No description

MismatchedEndBlock__finalise($res)

No description

match_MalformedOpenTag($stack = array())

No description

MalformedOpenTag__finalise($res)

No description

match_MalformedCloseTag($stack = array())

No description

MalformedCloseTag__finalise($res)

No description

match_MalformedBlock($stack = array())

No description

match_Comment($stack = array())

No description

Comment__construct($res)

No description

match_TopTemplate($stack = array())

No description

TopTemplate__construct($res)

The TopTemplate also includes the opening stanza to start off the template

match_Text($stack = array())

No description

Text__finalise($res)

We convert text

string
compileString(string $string, string $templateName = "", bool $includeDebuggingComments = false, bool $topTemplate = true)

Compiles some passed template source code into the php code that will execute as per the template source.

mixed|string
compileFile($template)

Compiles some file that contains template source code, and returns the php code that will execute as per that source

static array
getTranslatables(string $template, bool $warnIfEmpty = true)

Parses a template and returns any translatable entities

array
getEntities()

No description

Details

at line 45
__construct(string $string, bool $warnIfEmpty = true)

Parameters

string $string
bool $warnIfEmpty

in SSTemplateParser at line 99
construct($matchrule, $name, $arguments = null)

Override the function that constructs the result arrays to also prepare a 'php' item in the array

Parameters

$matchrule
$name
$arguments

in SSTemplateParser at line 116
setClosedBlocks(array $closedBlocks)

Set the closed blocks that the template parser should use

This method will delete any existing closed blocks, please use addClosedBlock if you don't want to overwrite

Parameters

array $closedBlocks

Exceptions

InvalidArgumentException

in SSTemplateParser at line 132
setOpenBlocks(array $openBlocks)

Set the open blocks that the template parser should use

This method will delete any existing open blocks, please use addOpenBlock if you don't want to overwrite

Parameters

array $openBlocks

Exceptions

InvalidArgumentException

in SSTemplateParser at line 146
addClosedBlock(string $name, callable $callable)

Add a closed block callable to allow <% name %><% end_name %> syntax

Parameters

string $name The name of the token to be used in the syntax <% name %><% end_name %>
callable $callable The function that modifies the generation of template code

Exceptions

InvalidArgumentException

in SSTemplateParser at line 158
addOpenBlock(string $name, callable $callable)

Add a closed block callable to allow <% name %> syntax

Parameters

string $name The name of the token to be used in the syntax <% name %>
callable $callable The function that modifies the generation of template code

Exceptions

InvalidArgumentException

in SSTemplateParser at line 194
match_Template($stack = array())

Parameters

$stack

in SSTemplateParser at line 442
Template_STR($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 449
match_Word($stack = array())

Parameters

$stack

in SSTemplateParser at line 461
match_NamespacedWord($stack = array())

Parameters

$stack

in SSTemplateParser at line 473
match_Number($stack = array())

Parameters

$stack

in SSTemplateParser at line 485
match_Value($stack = array())

Parameters

$stack

in SSTemplateParser at line 497
match_CallArguments($stack = array())

Parameters

$stack

in SSTemplateParser at line 550
CallArguments_Argument($res, $sub)

Values are bare words in templates, but strings in PHP. We rely on PHP's type conversion to back-convert strings to numbers when needed.

Parameters

$res
$sub

in SSTemplateParser at line 562
match_Call($stack = array())

Parameters

$stack

in SSTemplateParser at line 620
match_LookupStep($stack = array())

Parameters

$stack

in SSTemplateParser at line 653
match_LastLookupStep($stack = array())

Parameters

$stack

in SSTemplateParser at line 667
match_Lookup($stack = array())

Parameters

$stack

in SSTemplateParser at line 743
Lookup__construct($res)

Parameters

$res

in SSTemplateParser at line 754
Lookup_AddLookupStep($res, $sub, $method)

The basic generated PHP of LookupStep and LastLookupStep is the same, except that LookupStep calls 'obj' to get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj) depending on the context the lookup is used in.

Parameters

$res
$sub
$method

in SSTemplateParser at line 767
Lookup_LookupStep($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 772
Lookup_LastLookupStep($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 781
match_Translate($stack = array())

Parameters

$stack

in SSTemplateParser at line 894
match_InjectionVariables($stack = array())

Parameters

$stack

in SSTemplateParser at line 939
match_Entity($stack = array())

Parameters

$stack

at line 55
Translate__construct($res)

Parameters

$res

at line 61
Translate_Entity($res, $sub)

Parameters

$res
$sub

at line 67
Translate_Default($res, $sub)

Parameters

$res
$sub

at line 72
Translate_Context($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 971
Translate_InjectionVariables($res, $sub)

Parameters

$res
$sub

at line 77
Translate__finalise($res)

Parameters

$res

in SSTemplateParser at line 981
InjectionVariables__construct($res)

Parameters

$res

in SSTemplateParser at line 986
InjectionVariables_InjectionName($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 991
InjectionVariables_Argument($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 996
InjectionVariables__finalise($res)

Parameters

$res

in SSTemplateParser at line 1007
match_SimpleInjection($stack = array())

Parameters

$stack

in SSTemplateParser at line 1032
match_BracketInjection($stack = array())

Parameters

$stack

in SSTemplateParser at line 1059
match_Injection($stack = array())

Parameters

$stack

in SSTemplateParser at line 1090
Injection_STR($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1097
match_DollarMarkedLookup($stack = array())

Parameters

$stack

in SSTemplateParser at line 1110
DollarMarkedLookup_STR($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1117
match_QuotedString($stack = array())

Parameters

$stack

in SSTemplateParser at line 1153
match_FreeString($stack = array())

Parameters

$stack

in SSTemplateParser at line 1169
match_Argument($stack = array())

Parameters

$stack

in SSTemplateParser at line 1280
Argument_DollarMarkedLookup($res, $sub)

If we get a bare value, we don't know enough to determine exactly what php would be the translation, because we don't know if the position of use indicates a lookup or a string argument.

Instead, we record 'ArgumentMode' as a member of this matches results node, which can be: - lookup if this argument was unambiguously a lookup (marked as such) - string is this argument was unambiguously a string (marked as such, or impossible to parse as lookup) - default if this argument needs to be handled as per 2.4

In the case of 'default', there is no php member of the results node, but instead 'lookup_php', which should be used by the parent if the context indicates a lookup, and 'string_php' which should be used if the context indicates a string

Parameters

$res
$sub

in SSTemplateParser at line 1286
Argument_QuotedString($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1292
Argument_Lookup($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1304
Argument_FreeString($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1312
match_ComparisonOperator($stack = array())

Parameters

$stack

in SSTemplateParser at line 1423
match_Comparison($stack = array())

Parameters

$stack

in SSTemplateParser at line 1456
Comparison_Argument($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1469
Comparison_ComparisonOperator($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1476
match_PresenceCheck($stack = array())

Parameters

$stack

in SSTemplateParser at line 1519
PresenceCheck_Not($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1524
PresenceCheck_Argument($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1538
match_IfArgumentPortion($stack = array())

Parameters

$stack

in SSTemplateParser at line 1569
IfArgumentPortion_STR($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1576
match_BooleanOperator($stack = array())

Parameters

$stack

in SSTemplateParser at line 1604
match_IfArgument($stack = array())

Parameters

$stack

in SSTemplateParser at line 1653
IfArgument_IfArgumentPortion($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1658
IfArgument_BooleanOperator($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1665
match_IfPart($stack = array())

Parameters

$stack

in SSTemplateParser at line 1708
match_ElseIfPart($stack = array())

Parameters

$stack

in SSTemplateParser at line 1751
match_ElsePart($stack = array())

Parameters

$stack

in SSTemplateParser at line 1786
match_If($stack = array())

Parameters

$stack

in SSTemplateParser at line 1842
If_IfPart($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1850
If_ElseIfPart($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1858
If_ElsePart($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1868
match_Require($stack = array())

Parameters

$stack

in SSTemplateParser at line 1929
Require_Call($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 1944
match_CacheBlockArgument($stack = array())

Parameters

$stack

in SSTemplateParser at line 2041
CacheBlockArgument_DollarMarkedLookup($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2046
CacheBlockArgument_QuotedString($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2051
CacheBlockArgument_Lookup($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2058
match_CacheBlockArguments($stack = array())

Parameters

$stack

in SSTemplateParser at line 2106
CacheBlockArguments_CacheBlockArgument($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2120
match_CacheBlockTemplate($stack = array())

Parameters

$stack

in SSTemplateParser at line 2338
match_UncachedBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 2491
UncachedBlock_Template($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2499
match_CacheRestrictedTemplate($stack = array())

Parameters

$stack

in SSTemplateParser at line 2747
CacheRestrictedTemplate_CacheBlock($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2753
CacheRestrictedTemplate_UncachedBlock($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 2765
match_CacheBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 3001
CacheBlock__construct($res)

Parameters

$res

in SSTemplateParser at line 3006
CacheBlock_CacheBlockArguments($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3011
CacheBlock_Condition($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3016
CacheBlock_CacheBlock($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3021
CacheBlock_UncachedBlock($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3026
CacheBlock_CacheBlockTemplate($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3063
match_OldTPart($stack = array())

Parameters

$stack

in SSTemplateParser at line 3173
match_N($stack = array())

Parameters

$stack

in SSTemplateParser at line 3184
OldTPart__construct($res)

Parameters

$res

in SSTemplateParser at line 3189
OldTPart_QuotedString($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3199
OldTPart_CallArguments($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3204
OldTPart__finalise($res)

Parameters

$res

in SSTemplateParser at line 3211
match_OldTTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 3236
OldTTag_OldTPart($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3243
match_OldSprintfTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 3296
OldSprintfTag__construct($res)

Parameters

$res

in SSTemplateParser at line 3301
OldSprintfTag_OldTPart($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3306
OldSprintfTag_CallArguments($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3313
match_OldI18NTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 3344
OldI18NTag_STR($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3351
match_NamedArgument($stack = array())

Parameters

$stack

in SSTemplateParser at line 3381
NamedArgument_Name($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3386
NamedArgument_Value($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3405
match_Include($stack = array())

Parameters

$stack

in SSTemplateParser at line 3482
Include__construct($res)

Parameters

$res

in SSTemplateParser at line 3487
Include_Template($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3492
Include_NamedArgument($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3497
Include__finalise($res)

Parameters

$res

in SSTemplateParser at line 3516
match_BlockArguments($stack = array())

Parameters

$stack

in SSTemplateParser at line 3565
match_NotBlockTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 3720
match_ClosedBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 3828
ClosedBlock__construct($res)

As mentioned in the parser comment, block handling is kept fairly generic for extensibility. The match rule builds up two important elements in the match result array: 'ArgumentCount' - how many arguments were passed in the opening tag 'Arguments' an array of the Argument match rule result arrays

Once a block has successfully been matched against, it will then look for the actual handler, which should be on this class (either defined or extended on) as ClosedBlock_Handler_Name(&$res), where Name is the tag name, first letter captialized (i.e Control, Loop, With, etc).

This function will be called with the match rule result array as it's first argument. It should return the php result of this block as it's return value, or throw an error if incorrect arguments were passed.

Parameters

$res

in SSTemplateParser at line 3833
ClosedBlock_BlockArguments($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3844
ClosedBlock__finalise($res)

Parameters

$res

in SSTemplateParser at line 3862
ClosedBlock_Handle_Loop($res)

This is an example of a block handler function. This one handles the loop tag.

Parameters

$res

in SSTemplateParser at line 3893
ClosedBlock_Handle_With($res)

The closed block handler for with blocks

Parameters

$res

in SSTemplateParser at line 3914
match_OpenBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 3976
OpenBlock__construct($res)

Parameters

$res

in SSTemplateParser at line 3981
OpenBlock_BlockArguments($res, $sub)

Parameters

$res
$sub

in SSTemplateParser at line 3992
OpenBlock__finalise($res)

Parameters

$res

in SSTemplateParser at line 4010
OpenBlock_Handle_Debug($res)

This is an open block handler, for the <% debug %> utility tag

Parameters

$res

in SSTemplateParser at line 4031
OpenBlock_Handle_Base_tag($res)

This is an open block handler, for the <% base_tag %> tag

Parameters

$res

in SSTemplateParser at line 4042
OpenBlock_Handle_Current_page($res)

This is an open block handler, for the <% current_page %> tag

Parameters

$res

in SSTemplateParser at line 4052
match_MismatchedEndBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 4079
MismatchedEndBlock__finalise($res)

Parameters

$res

in SSTemplateParser at line 4088
match_MalformedOpenTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 4166
MalformedOpenTag__finalise($res)

Parameters

$res

in SSTemplateParser at line 4174
match_MalformedCloseTag($stack = array())

Parameters

$stack

in SSTemplateParser at line 4231
MalformedCloseTag__finalise($res)

Parameters

$res

in SSTemplateParser at line 4240
match_MalformedBlock($stack = array())

Parameters

$stack

in SSTemplateParser at line 4274
match_Comment($stack = array())

Parameters

$stack

in SSTemplateParser at line 4325
Comment__construct($res)

Parameters

$res

in SSTemplateParser at line 4333
match_TopTemplate($stack = array())

Parameters

$stack

in SSTemplateParser at line 4605
TopTemplate__construct($res)

The TopTemplate also includes the opening stanza to start off the template

Parameters

$res

in SSTemplateParser at line 4619
match_Text($stack = array())

Parameters

$stack

in SSTemplateParser at line 4826
Text__finalise($res)

We convert text

Parameters

$res

in SSTemplateParser at line 4865
string compileString(string $string, string $templateName = "", bool $includeDebuggingComments = false, bool $topTemplate = true)

Compiles some passed template source code into the php code that will execute as per the template source.

Parameters

string $string The source of the template
string $templateName The name of the template, normally the filename the template source was loaded from
bool $includeDebuggingComments True is debugging comments should be included in the output
bool $topTemplate True if this is a top template, false if it's just a template

Return Value

string The php that, when executed (via include or exec) will behave as per the template source

Exceptions

SSTemplateParseException

in SSTemplateParser at line 4944
mixed|string compileFile($template)

Compiles some file that contains template source code, and returns the php code that will execute as per that source

Parameters

$template
  • A file path that contains template source code

Return Value

mixed|string
  • The php that, when executed (via include or exec) will behave as per the template source

at line 110
static array getTranslatables(string $template, bool $warnIfEmpty = true)

Parses a template and returns any translatable entities

Parameters

string $template String to parse for translations
bool $warnIfEmpty Show warnings if default omitted

Return Value

array Map of keys -> values

at line 124
array getEntities()

Return Value

array