[ Index ]

PHP Cross Reference of phpBB-3.3.12-deutsch

title

Body

[close]

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

(no description)

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

Defines 61 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_sprintf()
  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_nl2br()
  twig_spaceless()
  twig_convert_encoding()
  twig_length_filter()
  twig_upper_filter()
  twig_lower_filter()
  twig_striptags()
  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()
  twig_check_arrow_in_sandbox()

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.

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

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.

return: mixed A random value from the given sequence
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

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") }}

return: string The formatted date
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

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") }}

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

twig_sprintf($format, ...$values)   X-Ref
Returns a formatted string.

return: string
param: string|null $format
param: ...$values

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 %}

return: \DateTimeInterface
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

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

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

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

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

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.

return: string The formatted number
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

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

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

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' } #}

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

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

return: mixed The sliced 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)

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

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

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

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

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 #}

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

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] #}

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

_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 %}

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

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

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

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

return: array
param: array|\Traversable $array

twig_in_filter($value, $compare)   X-Ref


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

return: string
param: string|null $string
param: string|null $characterMask
param: string      $side

twig_nl2br($string)   X-Ref
Inserts HTML line breaks before all newlines in a string.

return: string
param: string|null $string

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

return: string
param: string|null $string

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

return: string
param: string|null $string
param: string      $to
param: string      $from

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

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

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

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

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

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

twig_striptags($string, $allowable_tags = null)   X-Ref
Strips HTML and PHP tags from a string.

return: string
param: string|null $string
param: string[]|string|null $string

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

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

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

return: string The capitalized string
param: string|null $string A 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 %}

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

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 %}

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

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

return: string The rendered 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

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

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

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

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

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

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

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

return: array
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

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.

return: mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
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

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>

return: array The array of values
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

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

twig_check_arrow_in_sandbox(Environment $env, $arrow, $thing, $type)   X-Ref
No description



Generated: Sun Jun 23 12:25:44 2024 Cross-referenced by PHPXref 0.7.1