BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
LCRun3 Class Reference
Inheritance diagram for LCRun3:

Static Public Member Functions

static debug ($v, $f, $cx)
 
static miss ($cx, $v)
 
static v ($cx, $base, $path)
 
static ifvar ($cx, $v)
 
static ifv ($cx, $v, $in, $truecb, $falsecb=null)
 
static unl ($cx, $var, $in, $truecb, $falsecb=null)
 
static isec ($cx, $v)
 
static raw ($cx, $v)
 
static enc ($cx, $var)
 
static encq ($cx, $var)
 
static sec ($cx, $v, $in, $each, $cb, $else=null)
 
static wi ($cx, $v, $in, $cb, $else=null)
 
static p ($cx, $p, $v, $sp= '')
 
static ch ($cx, $ch, $vars, $op)
 
static chret ($ret, $op)
 
static hbch ($cx, $ch, $vars, $op, $inverted, $cb=null, $else=null)
 
static bch ($cx, $ch, $vars, $in, $inverted, $cb, $else=null)
 

Public Attributes

const DEBUG_ERROR_LOG = 1
 
const DEBUG_ERROR_EXCEPTION = 2
 
const DEBUG_TAGS = 4
 
const DEBUG_TAGS_ANSI = 12
 
const DEBUG_TAGS_HTML = 20
 

Detailed Description

LightnCandy static class for compiled template runtime methods.

Member Function Documentation

static LCRun3::bch (   $cx,
  $ch,
  $vars,
  $in,
  $inverted,
  $cb,
  $else = null 
)
static

LightnCandy runtime method for block custom helpers.

Parameters
array<string,array|string|integer>$cx render time context
string$chthe name of custom helper to be executed
array<array|string|integer>|string|integer|null$vars variables for the helper
array<array|string|integer>|string|integer|null$in input data with current scope
boolean$invertedthe logic will be inverted
Closure$cbcallback function to render child context
Closure | null$elsecallback function to render child context when {{else}}
Returns
string The rendered string of the token

'4.2.3' when input array('blockhelpers' => array('a' => function ($cx) {return array($cx,2,3);})), 'a', array(0, 0), 4, false, function($cx, $i) {return implode('.', $i);} '2.6.5' when input array('blockhelpers' => array('a' => function ($cx,$in) {return array($cx,$in[0],5);})), 'a', array('6', 0), 2, false, function($cx, $i) {return implode('.', $i);} '' when input array('blockhelpers' => array('a' => function ($cx,$in) {})), 'a', array('6', 0), 2, false, function($cx, $i) {return implode('.', $i);}

static LCRun3::ch (   $cx,
  $ch,
  $vars,
  $op 
)
static

LightnCandy runtime method for custom helpers.

Parameters
array<string,array|string|integer>$cx render time context
string$chthe name of custom helper to be executed
array<array>$vars variables for the helper
string$opthe name of variable resolver. should be one of: 'raw', 'enc', or 'encq'.
Returns
string The rendered string of the token

'=-=' when input array('helpers' => array('a' => function ($i) {return "=$i[0]=";})), 'a', array(array('-'),array()), 'raw' '=&=' when input array('helpers' => array('a' => function ($i) {return "=$i[0]=";})), 'a', array(array('&'),array()), 'enc' '=&#x27;=' when input array('helpers' => array('a' => function ($i) {return "=$i[0]=";})), 'a', array(array('\''),array()), 'encq' '=b=' when input array('helpers' => array('a' => function ($i,$j) {return "={$j['a']}=";})), 'a', array(array(),array('a' => 'b')), 'raw'

static LCRun3::chret (   $ret,
  $op 
)
static

LightnCandy runtime method to handle response of custom helpers.

Parameters
string|array<string,array|string|integer>$ret return value from custom helper
string$opthe name of variable resolver. should be one of: 'raw', 'enc', or 'encq'.
Returns
string The rendered string of the token

'=&=' when input '=&=', 'raw' '=&&#039;=' when input '=&\'=', 'enc' '=&&#x27;=' when input '=&\'=', 'encq' '=&&#039;=' when input array('=&\'='), 'enc' '=&&#x27;=' when input array('=&\'='), 'encq' '=&=' when input array('=&=', false), 'enc' '=&=' when input array('=&=', false), 'raw' '=&=' when input array('=&=', 'raw'), 'enc' '=&&#x27;=' when input array('=&\'=', 'encq'), 'raw'

static LCRun3::debug (   $v,
  $f,
  $cx 
)
static

LightnCandy runtime method for output debug info.

Parameters
string$vexpression
string$fruntime function name
array<string,array|string|integer>$cx render time context

'{{123}}' when input '123', 'miss', array('flags' => array('debug' => LCRun3::DEBUG_TAGS), 'lcrun' => 'LCRun3'), '' '{{#123}}{{/123}}' when input '123', 'wi', array('flags' => array('debug' => LCRun3::DEBUG_TAGS_HTML), 'lcrun' => 'LCRun3'), false, false, function () {return 'A';}

static LCRun3::enc (   $cx,
  $var 
)
static

LightnCandy runtime method for {{var}} .

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$var value to be htmlencoded
Returns
string The htmlencoded value of the specified variable

'a' when input array(), 'a' 'a&b' when input array(), 'a&b' 'a&#039;b' when input array(), 'a\'b'

static LCRun3::encq (   $cx,
  $var 
)
static

LightnCandy runtime method for {{var}} , and deal with single quote to same as handlebars.js .

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$var value to be htmlencoded
Returns
string The htmlencoded value of the specified variable

'a' when input array(), 'a' 'a&b' when input array(), 'a&b' 'a&#x27;b' when input array(), 'a\'b' '&#x60;a&#x27;b' when input array(), '`a\'b'

static LCRun3::hbch (   $cx,
  $ch,
  $vars,
  $op,
  $inverted,
  $cb = null,
  $else = null 
)
static

LightnCandy runtime method for Handlebars.js style custom helpers.

Parameters
array<string,array|string|integer>$cx render time context
string$chthe name of custom helper to be executed
array<array|string|integer>|string|integer|null$vars variables for the helper
string$opthe name of variable resolver. should be one of: 'raw', 'enc', or 'encq'.
boolean$invertedthe logic will be inverted
Closure | null$cbcallback function to render child context
Closure | null$elsecallback function to render child context when {{else}}
Returns
string The rendered string of the token
static LCRun3::ifv (   $cx,
  $v,
  $in,
  $truecb,
  $falsecb = null 
)
static

LightnCandy runtime method for {{if var}} when {{../var}} used.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value to be tested
array<array|string|integer>$in input data with current scope
Closure | null$truecbcallback function when test result is true
Closure | null$falsecbcallback function when test result is false
Returns
string The rendered string of the section

'' when input array('scopes' => array()), null, array(), null '' when input array('scopes' => array()), null, array(), function () {return 'Y';} 'Y' when input array('scopes' => array()), 1, array(), function () {return 'Y';} 'N' when input array('scopes' => array()), null, array(), function () {return 'Y';}, function () {return 'N';}

static LCRun3::ifvar (   $cx,
  $v 
)
static

LightnCandy runtime method for {{if var}}.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value to be tested
Returns
boolean Return true when the value is not null nor false.

false when input array(), null false when input array(), 0 false when input array(), false true when input array(), true true when input array(), 1 false when input array(), '' false when input array(), array() true when input array(), array('') true when input array(), array(0)

static LCRun3::isec (   $cx,
  $v 
)
static

LightnCandy runtime method for {{^var}} inverted section.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value to be tested
Returns
boolean Return true when the value is not null nor false.

true when input array(), null false when input array(), 0 true when input array(), false false when input array(), 'false' true when input array(), array() false when input array(), array('1')

static LCRun3::miss (   $cx,
  $v 
)
static

LightnCandy runtime method for missing data error.

Parameters
array<string,array|string|integer>$cx render time context
string$vexpression
static LCRun3::p (   $cx,
  $p,
  $v,
  $sp = '' 
)
static

LightnCandy runtime method for {{> partial}} .

Parameters
array<string,array|string|integer>$cx render time context
string$ppartial name
array<array|string|integer>|string|integer|null$v value to be the new context
Returns
string The rendered string of the partial
static LCRun3::raw (   $cx,
  $v 
)
static

LightnCandy runtime method for {{{var}}} .

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value to be output
Returns
string The raw value of the specified variable

true when input array('flags' => array('jstrue' => 0)), true 'true' when input array('flags' => array('jstrue' => 1)), true '' when input array('flags' => array('jstrue' => 0)), false 'false' when input array('flags' => array('jstrue' => 1)), false 'false' when input array('flags' => array('jstrue' => 1)), false, true 'Array' when input array('flags' => array('jstrue' => 1, 'jsobj' => 0)), array('a', 'b') 'a,b' when input array('flags' => array('jstrue' => 1, 'jsobj' => 1)), array('a', 'b') '[object Object]' when input array('flags' => array('jstrue' => 1, 'jsobj' => 1)), array('a', 'c' => 'b') '[object Object]' when input array('flags' => array('jstrue' => 1, 'jsobj' => 1)), array('c' => 'b') 'a,true' when input array('flags' => array('jstrue' => 1, 'jsobj' => 1)), array('a', true) 'a,1' when input array('flags' => array('jstrue' => 0, 'jsobj' => 1)), array('a',true) 'a,' when input array('flags' => array('jstrue' => 0, 'jsobj' => 1)), array('a',false) 'a,false' when input array('flags' => array('jstrue' => 1, 'jsobj' => 1)), array('a',false)

static LCRun3::sec (   $cx,
  $v,
  $in,
  $each,
  $cb,
  $else = null 
)
static

LightnCandy runtime method for {{#var}} section.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value for the section
array<array|string|integer>|string|integer|null$in input data with current scope
boolean$eachtrue when rendering #each
Closure$cbcallback function to render child context
Closure | null$elsecallback function to render child context when {{else}}
Returns
string The rendered string of the section

'' when input array('flags' => array('spvar' => 0)), false, false, false, function () {return 'A';} '' when input array('flags' => array('spvar' => 0)), null, null, false, function () {return 'A';} 'A' when input array('flags' => array('spvar' => 0)), true, true, false, function () {return 'A';} 'A' when input array('flags' => array('spvar' => 0)), 0, 0, false, function () {return 'A';} '-a=' when input array('flags' => array('spvar' => 0)), array('a'), array('a'), false, function ($c, $i) {return "-$i=";} '-a=-b=' when input array('flags' => array('spvar' => 0)), array('a','b'), array('a','b'), false, function ($c, $i) {return "-$i=";} '' when input array('flags' => array('spvar' => 0)), 'abc', 'abc', true, function ($c, $i) {return "-$i=";} '-b=' when input array('flags' => array('spvar' => 0)), array('a' => 'b'), array('a' => 'b'), true, function ($c, $i) {return "-$i=";} '1' when input array('flags' => array('spvar' => 0)), 'b', 'b', false, function ($c, $i) {return count($i);} '1' when input array('flags' => array('spvar' => 0)), 1, 1, false, function ($c, $i) {return print_r($i, true);} '0' when input array('flags' => array('spvar' => 0)), 0, 0, false, function ($c, $i) {return print_r($i, true);} '{"b":"c"}' when input array('flags' => array('spvar' => 0)), array('b' => 'c'), array('b' => 'c'), false, function ($c, $i) {return json_encode($i);} 'inv' when input array('flags' => array('spvar' => 0)), array(), 0, true, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), array(), 0, false, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), false, 0, true, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), false, 0, false, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), '', 0, true, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'cb' when input array('flags' => array('spvar' => 0)), '', 0, false, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), 0, 0, true, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'cb' when input array('flags' => array('spvar' => 0)), 0, 0, false, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'inv' when input array('flags' => array('spvar' => 0)), new stdClass, 0, true, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} 'cb' when input array('flags' => array('spvar' => 0)), new stdClass, 0, false, function ($c, $i) {return 'cb';}, function ($c, $i) {return 'inv';} '268' when input array('flags' => array('spvar' => 1), 'sp_vars'=>array('root' => 0)), array(1,3,4), 0, false, function ($c, $i) {return $i * 2;} '038' when input array('flags' => array('spvar' => 1), 'sp_vars'=>array('root' => 0)), array(1,3,'a'=>4), 0, true, function ($c, $i) {return $i * $c['sp_vars']['index'];}

static LCRun3::unl (   $cx,
  $var,
  $in,
  $truecb,
  $falsecb = null 
)
static

LightnCandy runtime method for {{#unless var}} when {{../var}} used.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$var value be tested
array<array|string|integer>|string|integer|null$in input data with current scope
Closure$truecbcallback function when test result is true
Closure | null$falsecbcallback function when test result is false
Returns
string Return rendered string when the value is not null nor false.

'' when input array('scopes' => array()), null, array(), null 'Y' when input array('scopes' => array()), null, array(), function () {return 'Y';} '' when input array('scopes' => array()), 1, array(), function () {return 'Y';} 'Y' when input array('scopes' => array()), null, array(), function () {return 'Y';}, function () {return 'N';} 'N' when input array('scopes' => array()), true, array(), function () {return 'Y';}, function () {return 'N';}

static LCRun3::v (   $cx,
  $base,
  $path 
)
static

LightnCandy runtime method for variable lookup. It is slower and only be used for instance property or method detection.

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>$base current variable context
array<string|integer>$path array of names for path
Returns
null|string Return the value or null when not found

null when input array('scopes' => array(), 'flags' => array('prop' => 0, 'method' => 0, 'mustlok' => 0)), 0, array('a', 'b') 3 when input array('scopes' => array(), 'flags' => array('prop' => 0, 'method' => 0), 'mustlok' => 0), array('a' => array('b' => 3)), array('a', 'b') null when input array('scopes' => array(), 'flags' => array('prop' => 0, 'method' => 0, 'mustlok' => 0)), (Object) array('a' => array('b' => 3)), array('a', 'b') 3 when input array('scopes' => array(), 'flags' => array('prop' => 1, 'method' => 0, 'mustlok' => 0)), (Object) array('a' => array('b' => 3)), array('a', 'b')

static LCRun3::wi (   $cx,
  $v,
  $in,
  $cb,
  $else = null 
)
static

LightnCandy runtime method for {{#with var}} .

Parameters
array<string,array|string|integer>$cx render time context
array<array|string|integer>|string|integer|null$v value to be the new context
array<array|string|integer>|string|integer|null$in input data with current scope
Closure$cbcallback function to render child context
Closure | null$elsecallback function to render child context when {{else}}
Returns
string The rendered string of the token

'' when input array(), false, false, function () {return 'A';} '' when input array(), null, null, function () {return 'A';} '{"a":"b"}' when input array(), array('a'=>'b'), array('a'=>'c'), function ($c, $i) {return json_encode($i);} '-b=' when input array(), 'b', array('a'=>'b'), function ($c, $i) {return "-$i=";}


The documentation for this class was generated from the following file: