[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/vendor/twig/twig/lib/Twig/Extension/ -> Core.php (summary)

(no description)

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

Defines 1 class

Twig_Extension_Core:: (64 methods):
  setEscaper()
  getEscapers()
  setDateFormat()
  getDateFormat()
  setTimezone()
  getTimezone()
  setNumberFormat()
  getNumberFormat()
  getTokenParsers()
  getFilters()
  getFunctions()
  getTests()
  getOperators()
  parseNotTestExpression()
  parseTestExpression()
  getTest()
  getTestNodeClass()
  getName()
  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_jsonencode_filter()
  twig_jsonencode_filter()
  _twig_markup2string()
  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_escape_filter()
  twig_escape_filter_is_safe()
  twig_convert_encoding()
  twig_convert_encoding()
  twig_convert_encoding()
  _twig_escape_js_callback()
  _twig_escape_css_callback()
  _twig_escape_html_attr_callback()
  twig_length_filter()
  twig_upper_filter()
  twig_lower_filter()
  twig_title_string_filter()
  twig_capitalize_string_filter()
  twig_length_filter()
  twig_title_string_filter()
  twig_capitalize_string_filter()
  twig_ensure_traversable()
  twig_test_empty()
  twig_test_iterable()
  twig_include()
  twig_source()
  twig_constant()
  twig_array_batch()


Class: Twig_Extension_Core  - X-Ref

setEscaper($strategy, $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: array 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

getOperators()   X-Ref
No description

parseNotTestExpression(Twig_Parser $parser, Twig_NodeInterface $node)   X-Ref
No description

parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $node)   X-Ref
No description

getTest(Twig_Parser $parser, $line)   X-Ref
No description

getTestNodeClass(Twig_Parser $parser, $test)   X-Ref
No description

getName()   X-Ref
No description

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

param: ArrayAccess|array $values   An array or an ArrayAccess instance
param: int               $position The cycle position
return: string The next value in the cycle

twig_random(Twig_Environment $env, $values = 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: Twig_Environment             $env    A Twig_Environment instance
param: Traversable|array|int|string $values The values to pick a random item from
return: mixed A random value from the given sequence

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

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

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

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

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

param: Twig_Environment $env      A Twig_Environment instance
param: DateTime|string  $date     A date
param: string           $modifier A modifier string
return: DateTime A new date object

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

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

param: Twig_Environment                       $env      A Twig_Environment instance
param: DateTime|DateTimeInterface|string|null $date     A date
param: DateTimeZone|string|null|false         $timezone The target timezone, null to use the default, false to leave unchanged
return: DateTime A DateTime instance

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

param: string            $str  String to replace in
param: array|Traversable $from Replace values
param: string|null       $to   Replace to, deprecated (@see http://php.net/manual/en/function.strtr.php)
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(Twig_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: Twig_Environment $env          A Twig_Environment instance
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_jsonencode_filter($value, $options = 0)   X-Ref
JSON encodes a variable.

param: mixed $value   The value to encode.
param: int   $options Not used on PHP 5.2.x
return: mixed The JSON encoded value

twig_jsonencode_filter($value, $options = 0)   X-Ref
JSON encodes a variable.

param: mixed $value   The value to encode.
param: int   $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT
return: mixed The JSON encoded value

_twig_markup2string(&$value)   X-Ref
No description

twig_array_merge($arr1, $arr2)   X-Ref
Merges an array with another one.

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

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

{# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
</pre>

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

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

param: Twig_Environment $env          A Twig_Environment instance
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(Twig_Environment $env, $item)   X-Ref
Returns the first element of the item.

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

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

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

twig_join_filter($value, $glue = '')   X-Ref
Joins the values to a string.

The separator between elements is an empty string per default, you can define it with the optional parameter.

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

{{ [1, 2, 3]|join }}
{# returns 123 #}
</pre>

param: array  $value An array
param: string $glue  The separator
return: string The concatenated string

twig_split_filter(Twig_Environment $env, $value, $delimiter, $limit = null)   X-Ref
Splits the string into an array.

<pre>
{{ "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] #}
</pre>

param: Twig_Environment $env       A Twig_Environment instance
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:

<pre>
{% for key in array|keys %}
{# ... #}
{% endfor %}
</pre>

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

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

param: Twig_Environment         $env          A Twig_Environment instance
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)   X-Ref
Sorts an array.

param: array|Traversable $array
return: array

twig_in_filter($value, $compare)   X-Ref


twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false)   X-Ref
Escapes a string.

param: Twig_Environment $env        A Twig_Environment instance
param: string           $string     The value to be escaped
param: string           $strategy   The escaping strategy
param: string           $charset    The charset
param: bool             $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false)
return: string

twig_escape_filter_is_safe(Twig_Node $filterArgs)   X-Ref


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

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

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

_twig_escape_js_callback($matches)   X-Ref
No description

_twig_escape_css_callback($matches)   X-Ref
No description

_twig_escape_html_attr_callback($matches)   X-Ref
This function is adapted from code coming from Zend Framework.


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

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

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The uppercased string

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The lowercased string

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The titlecased string

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The capitalized string

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

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

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The titlecased string

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

param: Twig_Environment $env    A Twig_Environment instance
param: string           $string A string
return: string The capitalized string

twig_ensure_traversable($seq)   X-Ref


twig_test_empty($value)   X-Ref
Checks if a variable is empty.

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

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.

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

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

twig_include(Twig_Environment $env, $context, $template, $variables = array()   X-Ref
Renders a template.

param: Twig_Environment $env
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(Twig_Environment $env, $name, $ignoreMissing = false)   X-Ref
Returns a template content without rendering it.

param: Twig_Environment $env
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: null|object $object   The object to get the constant from
return: string

twig_array_batch($items, $size, $fill = null)   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



Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1