Parser
in package
Table of Contents
- $args : array<string|int, mixed>|null
- $callbackFunction : array<string|int, mixed>|string
- $dontApplyParser : bool
- $onTheFlyVariables : bool
- $pattern : string
- $variablePattern : string
- $variableRegexp : bool
- $variables : mixed
- __construct() : mixed
- TplAssignVariablesParser constructor.
Properties
$args
public
array<string|int, mixed>|null
$args
$callbackFunction
public
array<string|int, mixed>|string
$callbackFunction
$dontApplyParser
public
bool
$dontApplyParser
$onTheFlyVariables
public
bool
$onTheFlyVariables
$pattern
public
string
$pattern
$variablePattern
public
string
$variablePattern
= '(.*)'
$variableRegexp
public
bool
$variableRegexp
$variables
public
mixed
$variables
Methods
__construct()
TplAssignVariablesParser constructor.
public
__construct(string $pattern, string|array<string|int, mixed> $callbackFunction[, string|null $variablePattern = null ][, string|array<string|int, mixed>|null $variables = null ][, bool $onTheFlyVariables = false ][, bool $variableRegexp = false ][, bool $dontApplyParser = false ][, array<string|int, mixed>|null $args = null ]) : mixed
Parameters
- $pattern : string
-
Pattern to search in template
- $callbackFunction : string|array<string|int, mixed>
-
Passed variables. If this is a string, it is used as callback function to get the variables during runtime (on the fly). If it's an array and $onTheFlyVariables is false, the given array will be passed as it is. If it's null, no variables will be passed.
- $variablePattern : string|null = null
-
The callback function to generate the replacements.
- $variables : string|array<string|int, mixed>|null = null
-
If this is true, the variables will be determined during runtime if you given a callback function in $variables. You can leave this empty if you pass $variables as one string because this is always interpreted as callback function. You can also leave this empty if you get the variables from anywhere else in your callback function.
- $onTheFlyVariables : bool = false
-
If your pattern detects the variable not as '(.*)', you must specify your variable pattern here.
- $variableRegexp : bool = false
-
If true, variable will be preg_matched as regex.
- $dontApplyParser : bool = false
-
Call function itself instead of applyParser().
- $args : array<string|int, mixed>|null = null
-
Pass additional data to parser.