Lexy
in package
Lexy class. Simple on the fly template parser class
based on: https://github.com/laravel/framework/blob/master/src/Illuminate/View/Compilers/BladeCompiler.php
Table of Contents
- $allowed_calls : array<string|int, mixed>
- [$allowed_calls description]
- $cachePath : mixed
- $compilers : mixed
- $extensions : mixed
- $srcinfo : mixed
- allowCall() : mixed
- execute() : mixed
- [execute description]
- extend() : mixed
- file() : mixed
- [file description]
- parse() : mixed
- [parse description]
- render() : mixed
- [render description]
- render_file() : mixed
- [render_file description]
- setCachePath() : mixed
- [setcachePath description]
- cache_file() : mixed
- check_security() : mixed
- [check_security description]
- check_syntax() : mixed
- [check_syntax description]
- compile() : mixed
- [compile description]
- compile_comments() : string
- Rewrites Lexi's comments into PHP comments.
- compile_default_structures() : string
- Rewrites Lexi's structure openings into PHP structure openings.
- compile_echos() : string
- Rewrites Lexi's echo statements into PHP echo statements.
- compile_else() : string
- Rewrites Lexi's else statements into PHP else statements.
- compile_extensions() : string
- Execute user defined compilers.
- compile_php_tags() : string
- Rewrites Lexi's php tags.
- compile_unescape_echos() : string
- Rewrites Lexi's escaped statements.
- compile_unless() : string
- Rewrites Lexi's "unless" statements into valid PHP.
- get_cached_file() : mixed
Properties
$allowed_calls
[$allowed_calls description]
protected
array<string|int, mixed>
$allowed_calls
= array(
// core
'true',
'false',
// string functions
'explode',
'implode',
'strtolower',
'strtoupper',
'substr',
'stristr',
'strpos',
'print',
'print_r',
'number_format',
'htmlentities',
'md5',
'strip_tags',
'htmlspecialchars',
// time functions
'date',
'time',
'mktime',
// math functions
'round',
'trunc',
'rand',
'ceil',
'floor',
'srand',
)
$cachePath
protected
mixed
$cachePath
= \false
$compilers
protected
mixed
$compilers
= array('extensions', 'comments', 'echos', 'unless', 'default_structures', 'else', 'unescape_echos', 'php_tags')
$extensions
protected
mixed
$extensions
= array()
$srcinfo
protected
mixed
$srcinfo
Methods
allowCall()
public
allowCall(mixed $call) : mixed
Parameters
- $call : mixed
Return values
mixed —execute()
[execute description]
public
execute(mixed $content[, array<string|int, mixed> $params = array() ][, bool $sandbox = false ][, mixed $srcinfo = null ]) : mixed
Parameters
- $content : mixed
- $params : array<string|int, mixed> = array()
-
[description]
- $sandbox : bool = false
-
[description]
- $srcinfo : mixed = null
Return values
mixed —extend()
public
extend(mixed $compiler) : mixed
Parameters
- $compiler : mixed
Return values
mixed —file()
[file description]
public
file(mixed $file[, array<string|int, mixed> $params = array() ][, bool $sandbox = false ]) : mixed
Parameters
- $file : mixed
- $params : array<string|int, mixed> = array()
-
[description]
- $sandbox : bool = false
-
[description]
Return values
mixed —parse()
[parse description]
public
parse(mixed $text[, bool $sandbox = false ][, mixed $srcinfo = null ]) : mixed
Parameters
- $text : mixed
- $sandbox : bool = false
-
[description]
- $srcinfo : mixed = null
Return values
mixed —render()
[render description]
public
static render(mixed $content[, mixed $params = array() ][, mixed $sandbox = false ][, mixed $srcinfo = null ]) : mixed
Parameters
- $content : mixed
- $params : mixed = array()
- $sandbox : mixed = false
- $srcinfo : mixed = null
Return values
mixed —render_file()
[render_file description]
public
static render_file(mixed $file[, array<string|int, mixed> $params = array() ][, bool $sandbox = false ]) : mixed
Parameters
- $file : mixed
- $params : array<string|int, mixed> = array()
-
[description]
- $sandbox : bool = false
-
[description]
Return values
mixed —setCachePath()
[setcachePath description]
public
setCachePath(mixed $path) : mixed
Parameters
- $path : mixed
Return values
mixed —cache_file()
protected
cache_file(mixed $file, mixed $cachedfile[, mixed $filemtime = null ][, mixed $sandbox = false ]) : mixed
Parameters
- $file : mixed
- $cachedfile : mixed
- $filemtime : mixed = null
- $sandbox : mixed = false
Return values
mixed —check_security()
[check_security description]
protected
check_security(mixed $code) : mixed
Parameters
- $code : mixed
Return values
mixed —check_syntax()
[check_syntax description]
protected
check_syntax(mixed $code) : mixed
Parameters
- $code : mixed
Return values
mixed —compile()
[compile description]
protected
compile(mixed $text[, bool $sandbox = false ]) : mixed
Parameters
- $text : mixed
- $sandbox : bool = false
-
[description]
Return values
mixed —compile_comments()
Rewrites Lexi's comments into PHP comments.
protected
compile_comments(string $value) : string
Parameters
- $value : string
Return values
string —compile_default_structures()
Rewrites Lexi's structure openings into PHP structure openings.
protected
compile_default_structures(string $value) : string
Parameters
- $value : string
Return values
string —compile_echos()
Rewrites Lexi's echo statements into PHP echo statements.
protected
compile_echos(string $value) : string
Parameters
- $value : string
Return values
string —compile_else()
Rewrites Lexi's else statements into PHP else statements.
protected
compile_else(string $value) : string
Parameters
- $value : string
Return values
string —compile_extensions()
Execute user defined compilers.
protected
compile_extensions(string $value) : string
Parameters
- $value : string
Return values
string —compile_php_tags()
Rewrites Lexi's php tags.
protected
compile_php_tags(string $value) : string
Parameters
- $value : string
Return values
string —compile_unescape_echos()
Rewrites Lexi's escaped statements.
protected
compile_unescape_echos(string $value) : string
Parameters
- $value : string
Return values
string —compile_unless()
Rewrites Lexi's "unless" statements into valid PHP.
protected
compile_unless(string $value) : string
Parameters
- $value : string
Return values
string —get_cached_file()
protected
get_cached_file(mixed $file, mixed $sandbox) : mixed
Parameters
- $file : mixed
- $sandbox : mixed