\

Namespaces

App
BaconQrCode
Endroid
GK
Medoo
Monolog
MyCLabs
PHPMailer
Psr
Symfony
Twig
Whoops
Zxing

Interfaces

Twig_CacheInterface Interface implemented by cache classes.
Twig_ExistsLoaderInterface Empty interface for Twig 1.x compatibility.
Twig_Extension_GlobalsInterface Enables usage of the deprecated Twig_Extension::getGlobals() method.
Twig_Extension_InitRuntimeInterface Enables usage of the deprecated Twig_Extension::initRuntime() method.
Twig_ExtensionInterface Interface implemented by extension classes.
Twig_LoaderInterface Interface all loaders must implement.
Twig_NodeCaptureInterface Represents a node that captures any nested displayable nodes.
Twig_NodeOutputInterface Represents a displayable node in the AST.
Twig_NodeVisitorInterface Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
Twig_RuntimeLoaderInterface Creates runtime implementations for Twig elements (filters/functions/tests).
Twig_Sandbox_SecurityPolicyInterface Interfaces that all security policy classes must implements.
Twig_SourceContextLoaderInterface Empty interface for Twig 1.x compatibility.
Twig_TokenParserInterface Interface implemented by token parsers.

Classes

QrReader
Twig_BaseNodeVisitor Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
Twig_Cache_Filesystem Implements a cache on the filesystem.
Twig_Cache_Null Implements a no-cache strategy.
Twig_Compiler Compiles a node to PHP code.
Twig_ContainerRuntimeLoader Lazily loads Twig runtime implementations from a PSR-11 container.
Twig_Environment Stores the Twig configuration.
Twig_Error Twig base exception.
Twig_Error_Loader Exception thrown when an error occurs during template loading.
Twig_Error_Runtime Exception thrown when an error occurs at runtime.
Twig_Error_Syntax Exception thrown when a syntax error occurs during lexing or parsing of a template.
Twig_ExpressionParser Parses expressions.
Twig_Extension
Twig_Extension_Core
Twig_Extension_Debug
Twig_Extension_Escaper
Twig_Extension_Optimizer
Twig_Extension_Profiler
Twig_Extension_Sandbox
Twig_Extension_Staging Used by Twig_Environment as a staging area.
Twig_Extension_StringLoader
Twig_ExtensionSet
Twig_FactoryRuntimeLoader Lazy loads the runtime implementations for a Twig element.
Twig_FileExtensionEscapingStrategy Default autoescaping strategy based on file names.
Twig_Filter Represents a template filter.
Twig_Function Represents a template function.
Twig_Lexer Lexes a template string.
Twig_Loader_Array Loads a template from an array.
Twig_Loader_Chain Loads templates from other loaders.
Twig_Loader_Filesystem Loads template from the filesystem.
Twig_Markup Marks a content as safe.
Twig_Node Represents a node in the AST.
Twig_Node_AutoEscape Represents an autoescape node.
Twig_Node_Block Represents a block node.
Twig_Node_BlockReference Represents a block call node.
Twig_Node_Body Represents a body node.
Twig_Node_CheckSecurity Represents a node in the AST.
Twig_Node_Deprecated Represents a deprecated node.
Twig_Node_Do Represents a do node.
Twig_Node_Embed Represents an embed node.
Twig_Node_Expression Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Array Abstract class for all nodes that represents an expression.
Twig_Node_Expression_AssignName Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Add Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_And Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_BitwiseAnd Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_BitwiseOr Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_BitwiseXor Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Concat Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Div Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_EndsWith Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Equal Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_FloorDiv Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Greater Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_GreaterEqual Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_In Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Less Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_LessEqual Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Matches Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Mod Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Mul Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_NotEqual Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_NotIn Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Or Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Power Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Range Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_StartsWith Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Binary_Sub Abstract class for all nodes that represents an expression.
Twig_Node_Expression_BlockReference Represents a block call node.
Twig_Node_Expression_Call Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Conditional Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Constant Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Filter Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Filter_Default Returns the value or the default value when it is undefined or empty.
Twig_Node_Expression_Function Abstract class for all nodes that represents an expression.
Twig_Node_Expression_GetAttr Abstract class for all nodes that represents an expression.
Twig_Node_Expression_MethodCall Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Name Abstract class for all nodes that represents an expression.
Twig_Node_Expression_NullCoalesce Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Parent Represents a parent node.
Twig_Node_Expression_TempName Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Test Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Test_Constant Checks if a variable is the exact same value as a constant.
Twig_Node_Expression_Test_Defined Checks if a variable is defined in the current context.
Twig_Node_Expression_Test_Divisibleby Checks if a variable is divisible by a number.
Twig_Node_Expression_Test_Even Checks if a number is even.
Twig_Node_Expression_Test_Null Checks that a variable is null.
Twig_Node_Expression_Test_Odd Checks if a number is odd.
Twig_Node_Expression_Test_Sameas Checks if a variable is the same as another one (=== in PHP).
Twig_Node_Expression_Unary Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Unary_Neg Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Unary_Not Abstract class for all nodes that represents an expression.
Twig_Node_Expression_Unary_Pos Abstract class for all nodes that represents an expression.
Twig_Node_Flush Represents a flush node.
Twig_Node_For Represents a for node.
Twig_Node_ForLoop Internal node used by the for node.
Twig_Node_If Represents an if node.
Twig_Node_Import Represents an import node.
Twig_Node_Include Represents an include node.
Twig_Node_Macro Represents a macro node.
Twig_Node_Module Represents a module node.
Twig_Node_Print Represents a node that outputs an expression.
Twig_Node_Sandbox Represents a sandbox node.
Twig_Node_SandboxedPrint Twig_Node_SandboxedPrint adds a check for the __toString() method when the variable is an object and the sandbox is activated.
Twig_Node_Set Represents a set node.
Twig_Node_Spaceless Represents a spaceless node.
Twig_Node_Text Represents a text node.
Twig_Node_With Represents a nested "with" scope.
Twig_NodeTraverser Twig_NodeTraverser is a node traverser.
Twig_NodeVisitor_Escaper Twig_NodeVisitor_Escaper implements output escaping.
Twig_NodeVisitor_Optimizer Twig_NodeVisitor_Optimizer tries to optimizes the AST.
Twig_NodeVisitor_SafeAnalysis Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
Twig_NodeVisitor_Sandbox Twig_NodeVisitor_Sandbox implements sandboxing.
Twig_Parser Default parser implementation.
Twig_Profiler_Dumper_Base
Twig_Profiler_Dumper_Blackfire
Twig_Profiler_Dumper_Html
Twig_Profiler_Dumper_Text
Twig_Profiler_Node_EnterProfile Represents a profile enter node.
Twig_Profiler_Node_LeaveProfile Represents a profile leave node.
Twig_Profiler_NodeVisitor_Profiler Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
Twig_Profiler_Profile
Twig_Sandbox_SecurityError Exception thrown when a security error occurs at runtime.
Twig_Sandbox_SecurityNotAllowedFilterError Exception thrown when a not allowed filter is used in a template.
Twig_Sandbox_SecurityNotAllowedFunctionError Exception thrown when a not allowed function is used in a template.
Twig_Sandbox_SecurityNotAllowedMethodError Exception thrown when a not allowed class method is used in a template.
Twig_Sandbox_SecurityNotAllowedPropertyError Exception thrown when a not allowed class property is used in a template.
Twig_Sandbox_SecurityNotAllowedTagError Exception thrown when a not allowed tag is used in a template.
Twig_Sandbox_SecurityPolicy Represents a security policy which need to be enforced when sandbox mode is enabled.
Twig_SimpleFilter Represents a template filter.
Twig_SimpleFunction Represents a template function.
Twig_SimpleTest Represents a template test.
Twig_Source Holds information about a non-compiled Twig template.
Twig_TemplateWrapper Exposes a template to userland.
Twig_Test Represents a template test.
Twig_Test_IntegrationTestCase Integration test helper.
Twig_Test_NodeTestCase
Twig_Token Represents a Token.
Twig_TokenParser Base class for all token parsers.
Twig_TokenParser_AutoEscape Marks a section of a template to be escaped or not.
Twig_TokenParser_Block Marks a section of a template as being reusable.
Twig_TokenParser_Deprecated Deprecates a section of a template.
Twig_TokenParser_Do Evaluates an expression, discarding the returned value.
Twig_TokenParser_Embed Embeds a template.
Twig_TokenParser_Extends Extends a template by another one.
Twig_TokenParser_Filter Filters a section of a template by applying filters.
Twig_TokenParser_Flush Flushes the output to the client.
Twig_TokenParser_For Loops over each item of a sequence.
Twig_TokenParser_From Imports macros.
Twig_TokenParser_If Tests a condition.
Twig_TokenParser_Import Imports macros.
Twig_TokenParser_Include Includes a template.
Twig_TokenParser_Macro Defines a macro.
Twig_TokenParser_Sandbox Marks a section of a template as untrusted code that must be evaluated in the sandbox mode.
Twig_TokenParser_Set Defines a variable.
Twig_TokenParser_Spaceless Remove whitespaces between HTML tags.
Twig_TokenParser_Use Imports blocks defined in another template into the current template.
Twig_TokenParser_With Creates a nested scope.
Twig_TokenStream Represents a token stream.
Twig_Util_DeprecationCollector
Twig_Util_TemplateDirIterator

Constants

APP_PATH

APP_PATH = dirname(realpath(GK_PATH)) . DS . 'Application' . DS

CONF_EXT

CONF_EXT = EXT

CONF_PATH

CONF_PATH = APP_PATH

CORE_PATH

CORE_PATH = LIB_PATH . 'GKLib' . DS

DS

DS = DIRECTORY_SEPARATOR

ENV_PREFIX

ENV_PREFIX = 'PHP_'

EXT

EXT = '.php'

EXTEND_PATH

EXTEND_PATH = ROOT_PATH . 'Extend' . DS

Framework

Framework = 'GKPHP'

GKPHP 引导文件

GK_PATH

GK_PATH = __DIR__ . DS

GK_VERSION

GK_VERSION = '2.0.1'

IS_CLI

IS_CLI = PHP_SAPI == 'cli' ? true : false

IS_WIN

IS_WIN = strpos(PHP_OS, 'WIN') !== false

LIB_PATH

LIB_PATH = GK_PATH . 'Library' . DS

MB_CASE_LOWER

MB_CASE_LOWER = 1

MB_CASE_TITLE

MB_CASE_TITLE = 2

MB_CASE_UPPER

MB_CASE_UPPER = 0

PUBLIC_PATH

PUBLIC_PATH = dirname(realpath(GK_PATH)) . DS . 'Public' . DS

ROOT_PATH

ROOT_PATH = dirname(realpath(APP_PATH)) . DS

RUNTIME_PATH

RUNTIME_PATH = ROOT_PATH . 'Runtime' . DS

VENDOR_PATH

VENDOR_PATH = ROOT_PATH . 'Vendor' . DS

Functions

arraycopy()

arraycopy(  $srcArray,   $srcPos,   $destArray,   $destPos,   $length) 

Parameters

$srcArray
$srcPos
$destArray
$destPos
$length

C()

C(  $Controllers) 

Parameters

$Controllers

ctype_alnum()

ctype_alnum(  $text) 

Parameters

$text

ctype_alpha()

ctype_alpha(  $text) 

Parameters

$text

ctype_cntrl()

ctype_cntrl(  $text) 

Parameters

$text

ctype_digit()

ctype_digit(  $text) 

Parameters

$text

ctype_graph()

ctype_graph(  $text) 

Parameters

$text

ctype_lower()

ctype_lower(  $text) 

Parameters

$text

ctype_print()

ctype_print(  $text) 

Parameters

$text

ctype_punct()

ctype_punct(  $text) 

Parameters

$text

ctype_space()

ctype_space(  $text) 

Parameters

$text

ctype_upper()

ctype_upper(  $text) 

Parameters

$text

ctype_xdigit()

ctype_xdigit(  $text) 

Parameters

$text

DB()

DB(  $Name = 'Mysql') 

Parameters

$Name

F()

F(  $Common,   $Module = '') 

Parameters

$Common
$Module

fill_array()

fill_array(  $index,   $count,   $value) 

Parameters

$index
$count
$value

floatToIntBits()

floatToIntBits(  $float_val) 

Parameters

$float_val

hashCode()

hashCode(  $s) 

Parameters

$s

intval32bits()

intval32bits(  $value) 

Parameters

$value

Json()

Json() 

M()

M(  $Model,   $Module = '') 

Parameters

$Model
$Module

mb_check_encoding()

mb_check_encoding(  $var = null,   $encoding = null) 

Parameters

$var
$encoding

mb_chr()

mb_chr(  $code,   $enc = null) 

Parameters

$code
$enc

mb_convert_case()

mb_convert_case(  $s,   $mode,   $enc = null) 

Parameters

$s
$mode
$enc

mb_convert_encoding()

mb_convert_encoding(  $s,   $to,   $from = null) 

Parameters

$s
$to
$from

mb_convert_variables()

mb_convert_variables(  $toEncoding,   $fromEncoding,   $a = null,   $b = null,   $c = null,   $d = null,   $e = null,   $f = null) 

Parameters

$toEncoding
$fromEncoding
$a
$b
$c
$d
$e
$f

mb_decode_mimeheader()

mb_decode_mimeheader(  $s) 

Parameters

$s

mb_decode_numericentity()

mb_decode_numericentity(  $s,   $convmap,   $enc = null) 

Parameters

$s
$convmap
$enc

mb_detect_encoding()

mb_detect_encoding(  $str,   $encodingList = null,   $strict = false) 

Parameters

$str
$encodingList
$strict

mb_detect_order()

mb_detect_order(  $encodingList = null) 

Parameters

$encodingList

mb_encode_mimeheader()

mb_encode_mimeheader(  $s,   $charset = null,   $transferEnc = null,   $lf = null,   $indent = null) 

Parameters

$s
$charset
$transferEnc
$lf
$indent

mb_encode_numericentity()

mb_encode_numericentity(  $s,   $convmap,   $enc = null,   $is_hex = false) 

Parameters

$s
$convmap
$enc
$is_hex

mb_encoding_aliases()

mb_encoding_aliases(  $encoding) 

Parameters

$encoding

mb_get_info()

mb_get_info(  $type = 'all') 

Parameters

$type

mb_http_input()

mb_http_input(  $type = '') 

Parameters

$type

mb_http_output()

mb_http_output(  $enc = null) 

Parameters

$enc

mb_internal_encoding()

mb_internal_encoding(  $enc = null) 

Parameters

$enc

mb_language()

mb_language(  $lang = null) 

Parameters

$lang

mb_list_encodings()

mb_list_encodings() 

mb_ord()

mb_ord(  $s,   $enc = null) 

Parameters

$s
$enc

mb_output_handler()

mb_output_handler(  $contents,   $status) 

Parameters

$contents
$status

mb_parse_str()

mb_parse_str(  $s,   $result = array()) 

Parameters

$s
$result

mb_scrub()

mb_scrub(  $s,   $enc = null) 

Parameters

$s
$enc

mb_stripos()

mb_stripos(  $s,   $needle,   $offset,   $enc = null) 

Parameters

$s
$needle
$offset
$enc

mb_stristr()

mb_stristr(  $s,   $needle,   $part = false,   $enc = null) 

Parameters

$s
$needle
$part
$enc

mb_strlen()

mb_strlen(  $s,   $enc = null) 

Parameters

$s
$enc

mb_strpos()

mb_strpos(  $s,   $needle,   $offset,   $enc = null) 

Parameters

$s
$needle
$offset
$enc

mb_strrchr()

mb_strrchr(  $s,   $needle,   $part = false,   $enc = null) 

Parameters

$s
$needle
$part
$enc

mb_strrichr()

mb_strrichr(  $s,   $needle,   $part = false,   $enc = null) 

Parameters

$s
$needle
$part
$enc

mb_strripos()

mb_strripos(  $s,   $needle,   $offset,   $enc = null) 

Parameters

$s
$needle
$offset
$enc

mb_strrpos()

mb_strrpos(  $s,   $needle,   $offset,   $enc = null) 

Parameters

$s
$needle
$offset
$enc

mb_strstr()

mb_strstr(  $s,   $needle,   $part = false,   $enc = null) 

Parameters

$s
$needle
$part
$enc

mb_strtolower()

mb_strtolower(  $s,   $enc = null) 

Parameters

$s
$enc

mb_strtoupper()

mb_strtoupper(  $s,   $enc = null) 

Parameters

$s
$enc

mb_strwidth()

mb_strwidth(  $s,   $enc = null) 

Parameters

$s
$enc

mb_substitute_character()

mb_substitute_character(  $char = null) 

Parameters

$char

mb_substr()

mb_substr(  $s,   $start,   $length = 2147483647,   $enc = null) 

Parameters

$s
$start
$length
$enc

mb_substr_count()

mb_substr_count(  $haystack,   $needle,   $enc = null) 

Parameters

$haystack
$needle
$enc

Number()

Number(  $Name = 'UID') 

Parameters

$Name

numberOfTrailingZeros()

numberOfTrailingZeros(  $i) 

Parameters

$i

overflow32()

overflow32(  $value) 

Parameters

$value

P()

P(  $var) 

Parameters

$var

Request()

Request() 

sdvig3()

sdvig3(  $a,   $b) 

Parameters

$a
$b

twig_array_batch()

twig_array_batch(array  $items, integer  $size, mixed  $fill = null) : array

Batches item.

Parameters

array $items

An array of items

integer $size

The size of the batch

mixed $fill

A value used to fill missing items

Returns

array

twig_array_merge()

twig_array_merge(array|\Traversable  $arr1, array|\Traversable  $arr2) : array

Merges an array with another one.

 {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}

 {% set items = items|merge({ 'peugeot': 'car' }) %}

 {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}

Parameters

array|\Traversable $arr1

An array

array|\Traversable $arr2

An array

Returns

array —

The merged array

twig_capitalize_string_filter()

twig_capitalize_string_filter(\Twig_Environment  $env, string  $string) : string

Returns a capitalized string.

Parameters

\Twig_Environment $env
string $string

A string

Returns

string —

The capitalized string

twig_constant()

twig_constant(string  $constant, object|null  $object = null) : string

Provides the ability to get constants from instances as well as class/global constants.

Parameters

string $constant

The name of the constant

object|null $object

The object to get the constant from

Returns

string

twig_constant_is_defined()

twig_constant_is_defined(string  $constant, object|null  $object = null) : boolean

Checks if a constant exists.

Parameters

string $constant

The name of the constant

object|null $object

The object to get the constant from

Returns

boolean

twig_convert_encoding()

twig_convert_encoding(  $string,   $to,   $from) 

Parameters

$string
$to
$from

twig_cycle()

twig_cycle(\ArrayAccess|array  $values, integer  $position) : string

Cycles over a value.

Parameters

\ArrayAccess|array $values
integer $position

The cycle position

Returns

string —

The next value in the cycle

twig_date_converter()

twig_date_converter(\Twig_Environment  $env, \DateTimeInterface|string|null  $date = null, \DateTimeZone|string|false|null  $timezone = null) : \DateTime

Converts an input to a DateTime instance.

   {% if date(user.created_at) < date('+2days') %}
     {# do something #}
   {% endif %}

Parameters

\Twig_Environment $env
\DateTimeInterface|string|null $date

A date or null to use the current time

\DateTimeZone|string|false|null $timezone

The target timezone, null to use the default, false to leave unchanged

Returns

\DateTime —

A DateTime instance

twig_date_format_filter()

twig_date_format_filter(\Twig_Environment  $env, \DateTimeInterface|\DateInterval|string  $date, string|null  $format = null, \DateTimeZone|string|false|null  $timezone = null) : string

Converts a date to the given format.

  {{ post.published_at|date("m/d/Y") }}

Parameters

\Twig_Environment $env
\DateTimeInterface|\DateInterval|string $date

A date

string|null $format

The target format, null to use the default

\DateTimeZone|string|false|null $timezone

The target timezone, null to use the default, false to leave unchanged

Returns

string —

The formatted date

twig_date_modify_filter()

twig_date_modify_filter(\Twig_Environment  $env, \DateTimeInterface|string  $date, string  $modifier) : \DateTimeInterface

Returns a new date object modified.

  {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}

Parameters

\Twig_Environment $env
\DateTimeInterface|string $date

A date

string $modifier

A modifier string

Returns

\DateTimeInterface —

A new date object

twig_escape_filter()

twig_escape_filter(\Twig_Environment  $env, mixed  $string, string  $strategy = 'html', string  $charset = null, boolean  $autoescape = false) : string

Escapes a string.

Parameters

\Twig_Environment $env
mixed $string

The value to be escaped

string $strategy

The escaping strategy

string $charset

The charset

boolean $autoescape

Whether the function is called by the auto-escaping feature (true) or by the developer (false)

Returns

string

twig_first()

twig_first(\Twig_Environment  $env, mixed  $item) : mixed

Returns the first element of the item.

Parameters

\Twig_Environment $env
mixed $item

A variable

Returns

mixed —

The first element of the item

twig_get_array_keys_filter()

twig_get_array_keys_filter(array  $array) : array

Returns the keys for the given array.

It is useful when you want to iterate over the keys of an array:

 {% for key in array|keys %}
     {# ... #}
 {% endfor %}

Parameters

array $array

An array

Returns

array —

The keys

twig_include()

twig_include(\Twig_Environment  $env, array  $context, string|array  $template, array  $variables = array(), boolean  $withContext = true, boolean  $ignoreMissing = false, boolean  $sandboxed = false) : string

Renders a template.

Parameters

\Twig_Environment $env
array $context
string|array $template

The template to render or an array of templates to try consecutively

array $variables

The variables to pass to the template

boolean $withContext
boolean $ignoreMissing

Whether to ignore missing templates or not

boolean $sandboxed

Whether to sandbox the template or not

Returns

string —

The rendered template

twig_join_filter()

twig_join_filter(array  $value, string  $glue = '', string|null  $and = null) : string

Joins the values to a string.

The separators between elements are empty strings per default, you can define them with the optional parameters.

 {{ [1, 2, 3]|join(', ', ' and ') }}
 {# returns 1, 2 and 3 #}

 {{ [1, 2, 3]|join('|') }}
 {# returns 1|2|3 #}

 {{ [1, 2, 3]|join }}
 {# returns 123 #}

Parameters

array $value

An array

string $glue

The separator

string|null $and

The separator for the last pair

Returns

string —

The concatenated string

twig_last()

twig_last(\Twig_Environment  $env, mixed  $item) : mixed

Returns the last element of the item.

Parameters

\Twig_Environment $env
mixed $item

A variable

Returns

mixed —

The last element of the item

twig_length_filter()

twig_length_filter(\Twig_Environment  $env, mixed  $thing) : integer

Returns the length of a variable.

Parameters

\Twig_Environment $env

A Twig_Environment instance

mixed $thing

A variable

Returns

integer —

The length of the value

twig_lower_filter()

twig_lower_filter(\Twig_Environment  $env, string  $string) : string

Converts a string to lowercase.

Parameters

\Twig_Environment $env
string $string

A string

Returns

string —

The lowercased string

twig_number_format_filter()

twig_number_format_filter(\Twig_Environment  $env, mixed  $number, integer  $decimal = null, string  $decimalPoint = null, string  $thousandSep = null) : string

Number format filter.

All of the formatting options can be left null, in that case the defaults will be used. Supplying any of the parameters will override the defaults set in the environment object.

Parameters

\Twig_Environment $env
mixed $number

A float/int/string of the number to format

integer $decimal

the number of decimal points to display

string $decimalPoint

the character(s) to use for the decimal point

string $thousandSep

the character(s) to use for the thousands separator

Returns

string —

The formatted number

twig_random()

twig_random(\Twig_Environment  $env, \Traversable|array|integer|float|string  $values = null) : mixed

Returns a random value depending on the supplied parameter type: - a random item from a Traversable or array - a random character from a string - a random integer between 0 and the integer parameter.

Parameters

\Twig_Environment $env
\Traversable|array|integer|float|string $values

The values to pick a random item from

Throws

\Twig_Error_Runtime

when $values is an empty array (does not apply to an empty string which is returned as is)

Returns

mixed —

A random value from the given sequence

twig_raw_filter()

twig_raw_filter(string  $string) : string

Marks a variable as being safe.

Parameters

string $string

A PHP variable

Returns

string

twig_replace_filter()

twig_replace_filter(string  $str, array|\Traversable  $from) : string

Replaces strings within a string.

Parameters

string $str

String to replace in

array|\Traversable $from

Replace values

Returns

string

twig_reverse_filter()

twig_reverse_filter(\Twig_Environment  $env, array|\Traversable|string  $item, boolean  $preserveKeys = false) : mixed

Reverses a variable.

Parameters

\Twig_Environment $env
array|\Traversable|string $item

An array, a Traversable instance, or a string

boolean $preserveKeys

Whether to preserve key or not

Returns

mixed —

The reversed input

twig_round()

twig_round(integer|float  $value, integer|float  $precision, string  $method = 'common') : integer|float

Rounds a number.

Parameters

integer|float $value

The value to round

integer|float $precision

The rounding precision

string $method

The method to use for rounding

Returns

integer|float —

The rounded number

twig_slice()

twig_slice(\Twig_Environment  $env, mixed  $item, integer  $start, integer  $length = null, boolean  $preserveKeys = false) : mixed

Slices a variable.

Parameters

\Twig_Environment $env
mixed $item

A variable

integer $start

Start of the slice

integer $length

Size of the slice

boolean $preserveKeys

Whether to preserve key or not (when the input is an array)

Returns

mixed —

The sliced variable

twig_sort_filter()

twig_sort_filter(array|\Traversable  $array) : array

Sorts an array.

Parameters

array|\Traversable $array

Returns

array

twig_source()

twig_source(\Twig_Environment  $env, string  $name, boolean  $ignoreMissing = false) : string

Returns a template content without rendering it.

Parameters

\Twig_Environment $env
string $name

The template name

boolean $ignoreMissing

Whether to ignore missing templates or not

Returns

string —

The template source

twig_split_filter()

twig_split_filter(\Twig_Environment  $env, string  $value, string  $delimiter, integer  $limit = null) : array

Splits the string into an array.

 {{ "one,two,three"|split(',') }}
 {# returns [one, two, three] #}

 {{ "one,two,three,four,five"|split(',', 3) }}
 {# returns [one, two, "three,four,five"] #}

 {{ "123"|split('') }}
 {# returns [1, 2, 3] #}

 {{ "aabbcc"|split('', 2) }}
 {# returns [aa, bb, cc] #}

Parameters

\Twig_Environment $env
string $value

A string

string $delimiter

The delimiter

integer $limit

The limit

Returns

array —

The split string as an array

twig_template_from_string()

twig_template_from_string(\Twig_Environment  $env, string  $template) : \Twig_Template

Loads a template from a string.

{{ include(template_from_string("Hello {{ name }}")) }}

Parameters

\Twig_Environment $env

A Twig_Environment instance

string $template

A template as a string or object implementing __toString()

Returns

\Twig_Template

twig_test_empty()

twig_test_empty(mixed  $value) : boolean

Checks if a variable is empty.

{# evaluates to true if the foo variable is null, false, or the empty string #}
{% if foo is empty %}
    {# ... #}
{% endif %}

Parameters

mixed $value

A variable

Returns

boolean —

true if the value is empty, false otherwise

twig_test_iterable()

twig_test_iterable(mixed  $value) : boolean

Checks if a variable is traversable.

{# evaluates to true if the foo variable is an array or a traversable object #}
{% if foo is iterable %}
    {# ... #}
{% endif %}

Parameters

mixed $value

A variable

Returns

boolean —

true if the value is traversable

twig_title_string_filter()

twig_title_string_filter(\Twig_Environment  $env, string  $string) : string

Returns a titlecased string.

Parameters

\Twig_Environment $env
string $string

A string

Returns

string —

The titlecased string

twig_trim_filter()

twig_trim_filter(  $string,   $characterMask = null,   $side = 'both') : string

Returns a trimmed string.

Parameters

$string
$characterMask
$side

Throws

\Twig_Error_Runtime

When an invalid trimming side is used (not a string or not 'left', 'right', or 'both')

Returns

string

twig_upper_filter()

twig_upper_filter(\Twig_Environment  $env, string  $string) : string

Converts a string to uppercase.

Parameters

\Twig_Environment $env
string $string

A string

Returns

string —

The uppercased string

twig_urlencode_filter()

twig_urlencode_filter(string|array  $url) : string

URL encodes (RFC 3986) a string as a path segment or an array as a query string.

Parameters

string|array $url

A URL or an array of query parameters

Returns

string —

The URL encoded value

twig_var_dump()

twig_var_dump(\Twig_Environment  $env,   $context,   $vars) 

Parameters

\Twig_Environment $env
$context
$vars

Url()

Url(  $Url = '',   $Value = '',   $Suffix = false,   $Domain = false) 

Parameters

$Url
$Value
$Suffix
$Domain

uRShift()

uRShift(  $a,   $b) 

Parameters

$a
$b