Documentation

Token
in package

LightnCandy Token handler

Table of Contents

POS_BACKFILL  = 13
POS_BEGINRAW  = 5
POS_BEGINTAG  = 3
POS_ENDRAW  = 8
POS_ENDTAG  = 10
POS_INNERTAG  = 7
POS_LOTHER  = 1
POS_LSPACE  = 2
POS_LSPACECTL  = 4
POS_OP  = 6
POS_ROTHER  = 12
POS_RSPACE  = 11
POS_RSPACECTL  = 9
VARNAME_SEARCH  = '/(\[[^\]]+\]|[^\[\]\.]+)/'
setDelimiter()  : mixed
Setup delimiter by default or provided string
toString()  : string
return token string

Constants

POS_BACKFILL

public mixed POS_BACKFILL = 13

POS_BEGINRAW

public mixed POS_BEGINRAW = 5

POS_BEGINTAG

public mixed POS_BEGINTAG = 3

POS_ENDRAW

public mixed POS_ENDRAW = 8

POS_ENDTAG

public mixed POS_ENDTAG = 10

POS_INNERTAG

public mixed POS_INNERTAG = 7

POS_LOTHER

public mixed POS_LOTHER = 1

POS_LSPACE

public mixed POS_LSPACE = 2

POS_LSPACECTL

public mixed POS_LSPACECTL = 4

POS_OP

public mixed POS_OP = 6

POS_ROTHER

public mixed POS_ROTHER = 12

POS_RSPACE

public mixed POS_RSPACE = 11

POS_RSPACECTL

public mixed POS_RSPACECTL = 9
public mixed VARNAME_SEARCH = '/(\[[^\]]+\]|[^\[\]\.]+)/'

Methods

setDelimiter()

Setup delimiter by default or provided string

public static setDelimiter(array<string, array|string|int> &$context[, string|null $left = null ][, string|null $right = null ]) : mixed
Parameters
$context : array<string, array|string|int>

Current context

$left : string|null = null

left string of a token

$right : string|null = null

right string of a token

Return values
mixed

toString()

return token string

public static toString(array<string|int, string> $token[, array<string|int, string>|null $merge = null ]) : string
Parameters
$token : array<string|int, string>

detected handlebars {{ }} token

$merge : array<string|int, string>|null = null

list of token strings to be merged

Tags
expect

'c' when input array(0, 'a', 'b', 'c', 'd', 'e')

expect

'cd' when input array(0, 'a', 'b', 'c', 'd', 'e', 'f')

expect

'qd' when input array(0, 'a', 'b', 'c', 'd', 'e', 'f'), array(3 => 'q')

Return values
string

Return whole token

Search results