Documentation

Context extends Flags
in package

LightnCandy class to handle Context

Table of Contents

FLAG_ADVARNAME  = 512
FLAG_BESTPERFORMANCE  = 16388
FLAG_ECHO  = 16384
FLAG_ELSE  = 16777216
FLAG_ERROR_EXCEPTION  = 2
FLAG_ERROR_LOG  = 1
FLAG_ERROR_SKIPPARTIAL  = 4194304
FLAG_EXTHELPER  = 8192
FLAG_HANDLEBARS  = 159390624
FLAG_HANDLEBARSJS  = 192945080
FLAG_HANDLEBARSJS_FULL  = 429235128
FLAG_HANDLEBARSLAMBDA  = 268435456
FLAG_HBESCAPE  = 256
FLAG_IGNORESTANDALONE  = 1073741824
FLAG_INSTANCE  = 98304
FLAG_JS  = 33554456
FLAG_JSLENGTH  = 33554432
FLAG_JSOBJECT  = 16
FLAG_JSTRUE  = 8
FLAG_KNOWNHELPERSONLY  = 4294967296
FLAG_METHOD  = 65536
FLAG_MUSTACHE  = 8597536856
FLAG_MUSTACHELAMBDA  = 2097152
FLAG_MUSTACHELOOKUP  = 262144
FLAG_MUSTACHESECTION  = 8589934592
FLAG_NAMEDARG  = 2048
FLAG_NOESCAPE  = 67108864
FLAG_NOHBHELPERS  = 64
FLAG_PARENT  = 128
FLAG_PARTIALNEWCONTEXT  = 536870912
FLAG_PREVENTINDENT  = 131072
FLAG_PROPERTY  = 32768
FLAG_RAWBLOCK  = 134217728
FLAG_RENDER_DEBUG  = 524288
FLAG_RUNTIMEPARTIAL  = 1048576
FLAG_SLASH  = 8388608
FLAG_SPVARS  = 4096
FLAG_STANDALONEPHP  = 4
FLAG_STRINGPARAMS  = 2147483648
FLAG_THIS  = 32
create()  : array<string, array|string|int>
Create a context from options
merge()  : mixed
Merge a context into another
updateHelperTable()  : array<string, array|string|int>
update specific custom helper table from options

Constants

FLAG_ADVARNAME

public mixed FLAG_ADVARNAME = 512

FLAG_BESTPERFORMANCE

public mixed FLAG_BESTPERFORMANCE = 16388

FLAG_ECHO

public mixed FLAG_ECHO = 16384

FLAG_ELSE

public mixed FLAG_ELSE = 16777216

FLAG_ERROR_EXCEPTION

public mixed FLAG_ERROR_EXCEPTION = 2

FLAG_ERROR_LOG

public mixed FLAG_ERROR_LOG = 1

FLAG_ERROR_SKIPPARTIAL

public mixed FLAG_ERROR_SKIPPARTIAL = 4194304

FLAG_EXTHELPER

public mixed FLAG_EXTHELPER = 8192

FLAG_HANDLEBARS

public mixed FLAG_HANDLEBARS = 159390624

FLAG_HANDLEBARSJS

public mixed FLAG_HANDLEBARSJS = 192945080

FLAG_HANDLEBARSJS_FULL

public mixed FLAG_HANDLEBARSJS_FULL = 429235128

FLAG_HANDLEBARSLAMBDA

public mixed FLAG_HANDLEBARSLAMBDA = 268435456

FLAG_HBESCAPE

public mixed FLAG_HBESCAPE = 256

FLAG_IGNORESTANDALONE

public mixed FLAG_IGNORESTANDALONE = 1073741824

FLAG_INSTANCE

public mixed FLAG_INSTANCE = 98304

FLAG_JS

public mixed FLAG_JS = 33554456

FLAG_JSLENGTH

public mixed FLAG_JSLENGTH = 33554432

FLAG_JSOBJECT

public mixed FLAG_JSOBJECT = 16

FLAG_JSTRUE

public mixed FLAG_JSTRUE = 8

FLAG_KNOWNHELPERSONLY

public mixed FLAG_KNOWNHELPERSONLY = 4294967296

FLAG_METHOD

public mixed FLAG_METHOD = 65536

FLAG_MUSTACHE

public mixed FLAG_MUSTACHE = 8597536856

FLAG_MUSTACHELAMBDA

public mixed FLAG_MUSTACHELAMBDA = 2097152

FLAG_MUSTACHELOOKUP

public mixed FLAG_MUSTACHELOOKUP = 262144

FLAG_MUSTACHESECTION

public mixed FLAG_MUSTACHESECTION = 8589934592

FLAG_NAMEDARG

public mixed FLAG_NAMEDARG = 2048

FLAG_NOESCAPE

public mixed FLAG_NOESCAPE = 67108864

FLAG_NOHBHELPERS

public mixed FLAG_NOHBHELPERS = 64

FLAG_PARENT

public mixed FLAG_PARENT = 128

FLAG_PARTIALNEWCONTEXT

public mixed FLAG_PARTIALNEWCONTEXT = 536870912

FLAG_PREVENTINDENT

public mixed FLAG_PREVENTINDENT = 131072

FLAG_PROPERTY

public mixed FLAG_PROPERTY = 32768

FLAG_RAWBLOCK

public mixed FLAG_RAWBLOCK = 134217728

FLAG_RENDER_DEBUG

public mixed FLAG_RENDER_DEBUG = 524288

FLAG_RUNTIMEPARTIAL

public mixed FLAG_RUNTIMEPARTIAL = 1048576

FLAG_SLASH

public mixed FLAG_SLASH = 8388608

FLAG_SPVARS

public mixed FLAG_SPVARS = 4096

FLAG_STANDALONEPHP

public mixed FLAG_STANDALONEPHP = 4

FLAG_STRINGPARAMS

public mixed FLAG_STRINGPARAMS = 2147483648

FLAG_THIS

public mixed FLAG_THIS = 32

Methods

create()

Create a context from options

public static create(array<string, array|string|int> $options) : array<string, array|string|int>
Parameters
$options : array<string, array|string|int>

input options

Return values
array<string, array|string|int>

Context from options

merge()

Merge a context into another

public static merge(array<string, array|string|int> &$context, array<string, array|string|int> $tmp) : mixed
Parameters
$context : array<string, array|string|int>

master context

$tmp : array<string, array|string|int>

another context will be overwrited into master context

Return values
mixed

updateHelperTable()

update specific custom helper table from options

protected static updateHelperTable(array<string, array|string|int> &$context, array<string, array|string|int> $options[, string $tname = 'helpers' ]) : array<string, array|string|int>
Parameters
$context : array<string, array|string|int>

prepared context

$options : array<string, array|string|int>

input options

$tname : string = 'helpers'

helper table name

Tags
expect

array() when input array(), array()

expect

array('flags' => array('exhlp' => 1), 'helpers' => array('abc' => 1)) when input array('flags' => array('exhlp' => 1)), array('helpers' => array('abc'))

expect

array('error' => array('You provide a custom helper named as 'abc' in options['helpers'], but the function abc() is not defined!'), 'flags' => array('exhlp' => 0)) when input array('error' => array(), 'flags' => array('exhlp' => 0)), array('helpers' => array('abc'))

expect

array('flags' => array('exhlp' => 1), 'helpers' => array('\LightnCandy\Runtime::raw' => '\LightnCandy\Runtime::raw')) when input array('flags' => array('exhlp' => 1), 'helpers' => array()), array('helpers' => array('\LightnCandy\Runtime::raw'))

expect

array('flags' => array('exhlp' => 1), 'helpers' => array('test' => '\LightnCandy\Runtime::raw')) when input array('flags' => array('exhlp' => 1), 'helpers' => array()), array('helpers' => array('test' => '\LightnCandy\Runtime::raw'))

Return values
array<string, array|string|int>

context with generated helper table

Search results