[ Index ]

PHP Cross Reference of phpBB-3.3.2-deutsch

title

Body

[close]

/vendor/twig/twig/src/Extension/ -> CoreExtension.php (summary)

(no description)

File Size: 1582 lines (52 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 57 functions

  setEscaper()
  getEscapers()
  setDateFormat()
  getDateFormat()
  setTimezone()
  getTimezone()
  setNumberFormat()
  getNumberFormat()
  getTokenParsers()
  getFilters()
  getFunctions()
  getTests()
  getNodeVisitors()
  getOperators()
  twig_cycle()
  twig_random()
  twig_date_format_filter()
  twig_date_modify_filter()
  twig_date_converter()
  twig_replace_filter()
  twig_round()
  twig_number_format_filter()
  twig_urlencode_filter()
  twig_array_merge()
  twig_slice()
  twig_first()
  twig_last()
  twig_join_filter()
  twig_split_filter()
  _twig_default_filter()
  twig_get_array_keys_filter()
  twig_reverse_filter()
  twig_sort_filter()
  twig_in_filter()
  twig_trim_filter()
  twig_spaceless()
  twig_convert_encoding()
  twig_length_filter()
  twig_upper_filter()
  twig_lower_filter()
  twig_title_string_filter()
  twig_capitalize_string_filter()
  twig_call_macro()
  twig_ensure_traversable()
  twig_to_array()
  twig_test_empty()
  twig_test_iterable()
  twig_include()
  twig_source()
  twig_constant()
  twig_constant_is_defined()
  twig_array_batch()
  twig_get_attribute()
  twig_array_column()
  twig_array_filter()
  twig_array_map()
  twig_array_reduce()

Functions
Functions that are not part of a class:

setEscaper($strategy, callable $callable)   X-Ref
Defines a new escaper to be used via the escape filter.

param: string   $strategy The strategy name that should be used as a strategy in the escape call
param: callable $callable A valid PHP callable

getEscapers()   X-Ref
Gets all defined escapers.

return: callable[] An array of escapers

setDateFormat($format = null, $dateIntervalFormat = null)   X-Ref
Sets the default format to be used by the date filter.

param: string $format             The default date format string
param: string $dateIntervalFormat The default date interval format string

getDateFormat()   X-Ref
Gets the default format to be used by the date filter.

return: array The default date format string and the default date interval format string

setTimezone($timezone)   X-Ref
Sets the default timezone to be used by the date filter.

param: \DateTimeZone|string $timezone The default timezone string or a \DateTimeZone object

getTimezone()   X-Ref
Gets the default timezone to be used by the date filter.

return: \DateTimeZone The default timezone currently in use

setNumberFormat($decimal, $decimalPoint, $thousandSep)   X-Ref
Sets the default format to be used by the number_format filter.

param: int    $decimal      the number of decimal places to use
param: string $decimalPoint the character(s) to use for the decimal point
param: string $thousandSep  the character(s) to use for the thousands separator

getNumberFormat()   X-Ref
Get the default format used by the number_format filter.

return: array The arguments for number_format()

getTokenParsers()   X-Ref
No description

getFilters()   X-Ref
No description

getFunctions()   X-Ref
No description

getTests()   X-Ref
No description

getNodeVisitors()   X-Ref
No description

getOperators()   X-Ref
No description

twig_cycle($values, $position)   X-Ref
Cycles over a value.

param: \ArrayAccess|array $values
param: int                $position The cycle position
return: string The next value in the cycle

twig_random(Environment $env, $values = null, $max = null)   X-Ref
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.

param: \Traversable|array|int|float|string $values The values to pick a random item from
param: int|null                            $max    Maximum value used when $values is an int
return: mixed A random value from the given sequence

twig_date_format_filter(Environment $env, $date, $format = null, $timezone = null)   X-Ref
Converts a date to the given format.

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

param: \DateTimeInterface|\DateInterval|string $date     A date
param: string|null                             $format   The target format, null to use the default
param: \DateTimeZone|string|false|null         $timezone The target timezone, null to use the default, false to leave unchanged
return: string The formatted date

twig_date_modify_filter(Environment $env, $date, $modifier)   X-Ref
Returns a new date object modified.

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

param: \DateTimeInterface|string $date     A date
param: string                    $modifier A modifier string
return: \DateTimeInterface

twig_date_converter(Environment $env, $date = null, $timezone = null)   X-Ref
Converts an input to a \DateTime instance.

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

param: \DateTimeInterface|string|null  $date     A date or null to use the current time
param: \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
return: \DateTimeInterface

twig_replace_filter($str, $from)   X-Ref
Replaces strings within a string.

param: string             $str  String to replace in
param: array|\Traversable $from Replace values
return: string

twig_round($value, $precision = 0, $method = 'common')   X-Ref
Rounds a number.

param: int|float $value     The value to round
param: int|float $precision The rounding precision
param: string    $method    The method to use for rounding
return: int|float The rounded number

twig_number_format_filter(Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)   X-Ref
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.

param: mixed  $number       A float/int/string of the number to format
param: int    $decimal      the number of decimal points to display
param: string $decimalPoint the character(s) to use for the decimal point
param: string $thousandSep  the character(s) to use for the thousands separator
return: string The formatted number

twig_urlencode_filter($url)   X-Ref
URL encodes (RFC 3986) a string as a path segment or an array as a query string.

param: string|array $url A URL or an array of query parameters
return: string The URL encoded value

twig_array_merge($arr1, $arr2)   X-Ref
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' } #}

param: array|\Traversable $arr1 An array
param: array|\Traversable $arr2 An array
return: array The merged array

twig_slice(Environment $env, $item, $start, $length = null, $preserveKeys = false)   X-Ref
Slices a variable.

param: mixed $item         A variable
param: int   $start        Start of the slice
param: int   $length       Size of the slice
param: bool  $preserveKeys Whether to preserve key or not (when the input is an array)
return: mixed The sliced variable

twig_first(Environment $env, $item)   X-Ref
Returns the first element of the item.

param: mixed $item A variable
return: mixed The first element of the item

twig_last(Environment $env, $item)   X-Ref
Returns the last element of the item.

param: mixed $item A variable
return: mixed The last element of the item

twig_join_filter($value, $glue = '', $and = null)   X-Ref
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 #}

param: array       $value An array
param: string      $glue  The separator
param: string|null $and   The separator for the last pair
return: string The concatenated string

twig_split_filter(Environment $env, $value, $delimiter, $limit = null)   X-Ref
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] #}

param: string $value     A string
param: string $delimiter The delimiter
param: int    $limit     The limit
return: array The split string as an array

_twig_default_filter($value, $default = '')   X-Ref


twig_get_array_keys_filter($array)   X-Ref
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 %}

param: array $array An array
return: array The keys

twig_reverse_filter(Environment $env, $item, $preserveKeys = false)   X-Ref
Reverses a variable.

param: array|\Traversable|string $item         An array, a \Traversable instance, or a string
param: bool                      $preserveKeys Whether to preserve key or not
return: mixed The reversed input

twig_sort_filter($array, $arrow = null)   X-Ref
Sorts an array.

param: array|\Traversable $array
return: array

twig_in_filter($value, $compare)   X-Ref


twig_trim_filter($string, $characterMask = null, $side = 'both')   X-Ref
Returns a trimmed string.

return: string

twig_spaceless($content)   X-Ref
Removes whitespaces between HTML tags.

return: string

twig_convert_encoding($string, $to, $from)   X-Ref
No description

twig_length_filter(Environment $env, $thing)   X-Ref
Returns the length of a variable.

param: mixed $thing A variable
return: int The length of the value

twig_upper_filter(Environment $env, $string)   X-Ref
Converts a string to uppercase.

param: string $string A string
return: string The uppercased string

twig_lower_filter(Environment $env, $string)   X-Ref
Converts a string to lowercase.

param: string $string A string
return: string The lowercased string

twig_title_string_filter(Environment $env, $string)   X-Ref
Returns a titlecased string.

param: string $string A string
return: string The titlecased string

twig_capitalize_string_filter(Environment $env, $string)   X-Ref
Returns a capitalized string.

param: string $string A string
return: string The capitalized string

twig_call_macro(Template $template, string $method, array $args, int $lineno, array $context, Source $source)   X-Ref


twig_ensure_traversable($seq)   X-Ref


twig_to_array($seq, $preserveKeys = true)   X-Ref


twig_test_empty($value)   X-Ref
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 %}

param: mixed $value A variable
return: bool true if the value is empty, false otherwise

twig_test_iterable($value)   X-Ref
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 %}

param: mixed $value A variable
return: bool true if the value is traversable

twig_include(Environment $env, $context, $template, $variables = [], $withContext = true, $ignoreMissing = false, $sandboxed = false)   X-Ref
Renders a template.

param: array        $context
param: string|array $template      The template to render or an array of templates to try consecutively
param: array        $variables     The variables to pass to the template
param: bool         $withContext
param: bool         $ignoreMissing Whether to ignore missing templates or not
param: bool         $sandboxed     Whether to sandbox the template or not
return: string The rendered template

twig_source(Environment $env, $name, $ignoreMissing = false)   X-Ref
Returns a template content without rendering it.

param: string $name          The template name
param: bool   $ignoreMissing Whether to ignore missing templates or not
return: string The template source

twig_constant($constant, $object = null)   X-Ref
Provides the ability to get constants from instances as well as class/global constants.

param: string      $constant The name of the constant
param: object|null $object   The object to get the constant from
return: string

twig_constant_is_defined($constant, $object = null)   X-Ref
Checks if a constant exists.

param: string      $constant The name of the constant
param: object|null $object   The object to get the constant from
return: bool

twig_array_batch($items, $size, $fill = null, $preserveKeys = true)   X-Ref
Batches item.

param: array $items An array of items
param: int   $size  The size of the batch
param: mixed $fill  A value used to fill missing items
return: array

twig_get_attribute(Environment $env, Source $source, $object, $item, array $arguments = [], $type = 'any', $isDefinedTest = false, $ignoreStrictCheck = false, $sandboxed = false, int $lineno = -1)   X-Ref
Returns the attribute value for a given array/object.

param: mixed  $object            The object or array from where to get the item
param: mixed  $item              The item to get from the array or object
param: array  $arguments         An array of arguments to pass if the item is an object method
param: string $type              The type of attribute (@see \Twig\Template constants)
param: bool   $isDefinedTest     Whether this is only a defined check
param: bool   $ignoreStrictCheck Whether to ignore the strict attribute check or not
param: int    $lineno            The template line where the attribute was called
return: mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true

twig_array_column($array, $name, $index = null)   X-Ref
Returns the values from a single column in the input array.

<pre>
{% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}

{% set fruits = items|column('fruit') %}

{# fruits now contains ['apple', 'orange'] #}
</pre>

param: array|Traversable $array An array
param: mixed             $name  The column name
param: mixed             $index The column to use as the index/keys for the returned array
return: array The array of values

twig_array_filter(Environment $env, $array, $arrow)   X-Ref
No description

twig_array_map(Environment $env, $array, $arrow)   X-Ref
No description

twig_array_reduce(Environment $env, $array, $arrow, $initial = null)   X-Ref
No description



Generated: Wed Nov 11 20:28:18 2020 Cross-referenced by PHPXref 0.7.1