This reference was automatically generated from code on 2024-03-10
Implemented in: Neos\Neos\Ui\Fusion\Helper\ApiHelper
Converts an empty array to an empty object. Does nothing if array is not empty.
Use this helper to prevent associative arrays from being converted to non-associative arrays by json_encode. This is an internal helper and might change without further notice FIXME: Probably better to produce objects in the first place "upstream".
array
(array) Associative array which may be empty
Return (array|stdClass) Non-empty associative array or empty object
Array helpers for Eel contexts
The implementation uses the JavaScript specificiation where applicable, including EcmaScript 6 proposals.
See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array for a documentation and specification of the JavaScript implementation.
Implemented in: Neos\Eel\Helper\ArrayHelper
Concatenate arrays or values to a new array
array1
(iterable|mixed) First array or valuearray2
(iterable|mixed) Second array or valuearray_
(iterable|mixed, optional) Optional variable list of additional arrays / values
Return (array) The array with concatenated arrays or values
Check if all elements in an array pass a test given by the calback, passing each element and key as arguments
Example:
Array.every([1, 2, 3, 4], x => x % 2 == 0) // == false
Array.every([2, 4, 6, 8], x => x % 2) // == true
array
(iterable) Array of elements to testcallback
(callable) Callback for testing elements, current value and key will be passed as arguments
Return (bool) True if all elements passed the test
Filter an array by a test given as the callback, passing each element and key as arguments
Examples:
Array.filter([1, 2, 3, 4], x => x % 2 == 0) // == [2, 4] Array.filter(['foo', 'bar', 'baz'], (x, index) => index < 2) // == ['foo', 'bar']
array
(iterable) Array of elements to filtercallback
(callable, optional) Callback for testing if an element should be included in the result, current value and key will be passed as arguments
Return (array) The array with elements where callback returned true
Get the first element of an array
array
(iterable) The array
Return (mixed)
Exchanges all keys with their associated values in an array
Note that the values of array need to be valid keys, i.e. they need to be either int or string. If a value has several occurrences, the latest key will be used as its value, and all others will be lost.
array
(iterable)
Return (array) The array with flipped keys and values
Returns the first index at which a given element can be found in the array, or -1 if it is not present
array
(iterable) The arraysearchElement
(mixed) The element value to findfromIndex
(int, optional) Position in the array to start the search.
Return (int)
Check if an array is empty
array
(iterable) The array
Return (bool) true if the array is empty
Join values of an array with a separator
array
(iterable) Array with values to joinseparator
(string, optional) A separator for the values
Return (string) A string with the joined values separated by the separator
Get the array keys
array
(iterable) The array
Return (array)
Sort an array by key
array
(iterable) The array to sort
Return (array) The sorted array
Get the last element of an array
array
(iterable) The array
Return (mixed)
Get the length of an array
array
(iterable) The array
Return (int)
Apply the callback to each element of the array, passing each element and key as arguments
Examples:
Array.map([1, 2, 3, 4], x => x * x)
Array.map([1, 2, 3, 4], (x, index) => x * index)
array
(iterable) Array of elements to mapcallback
(callable) Callback to apply for each element, current value and key will be passed as arguments
Return (array) The array with callback applied, keys will be preserved
Removes the last element from an array
Note: This differs from the JavaScript behavior of Array.pop which will return the popped element.
An empty array will result in an empty array again.
array
(iterable)
Return (array) The array without the last element
Insert one or more elements at the end of an array
Allows to push multiple elements at once:
Array.push(array, e1, e2)
array
(iterablenull)element
(mixed)
Return (array) The array with the inserted elements
Picks a random element from the array
array
(array)
Return (mixed) A random entry or null if the array is empty
Create an array containing a range of elements
If a step value is given, it will be used as the increment between elements in the sequence. step should be given as a positive number. If not specified, step will default to 1.
start
(mixed) First value of the sequence.end
(mixed) The sequence is ended upon reaching the end value.step
(int, optional) The increment between items, will default to 1.
Return (array) Array of elements from start to end, inclusive.
Apply the callback to each element of the array and accumulate a single value
Examples:
Array.reduce([1, 2, 3, 4], (accumulator, currentValue) => accumulator + currentValue) // == 10
Array.reduce([1, 2, 3, 4], (accumulator, currentValue) => accumulator + currentValue, 1) // == 11
array
(iterable) Array of elements to reduce to a valuecallback
(callable) Callback for accumulating values, accumulator, current value and key will be passed as argumentsinitialValue
(mixed, optional) Initial value, defaults to first item in array and callback starts with second entry
Return (mixed)
Returns an array in reverse order
array
(iterable) The array
Return (array)
Set the specified key in the the array
array
(iterable)key
(string|integer) the key that should be setvalue
(mixed) the value to assign to the key
Return (array) The modified array.
Remove the first element of an array
Note: This differs from the JavaScript behavior of Array.shift which will return the shifted element.
An empty array will result in an empty array again.
array
(iterable)
Return (array) The array without the first element
Shuffle an array
Randomizes entries an array with the option to preserve the existing keys. When this option is set to false, all keys will be replaced
array
(iterable)preserveKeys
(bool, optional) Wether to preserve the keys when shuffling the array
Return (array) The shuffled array
Extract a portion of an indexed array
array
(iterable) The array (with numeric indices)begin
(int)end
(int, optional)
Return (array)
Check if at least one element in an array passes a test given by the calback, passing each element and key as arguments
Example:
Array.some([1, 2, 3, 4], x => x % 2 == 0) // == true
Array.some([1, 2, 3, 4], x => x > 4) // == false
array
(iterable) Array of elements to testcallback
(callable) Callback for testing elements, current value and key will be passed as arguments
Return (bool) True if at least one element passed the test
Sorts an array
The sorting is done first by numbers, then by characters.
Internally natsort() is used as it most closely resembles javascript's sort(). Because there are no real associative arrays in Javascript, keys of the array will be preserved.
array
(iterable)
Return (array) The sorted array
Replaces a range of an array by the given replacements
Allows to give multiple replacements at once:
Array.splice(array, 3, 2, 'a', 'b')
array
(iterable)offset
(int) Index of the first element to removelength
(int, optional) Number of elements to removereplacements
(mixed, optional) Elements to insert instead of the removed range
Return (array) The array with removed and replaced elements
Removes duplicate values from an array
array
(iterable) The input array
Return (array) The filtered array.
Insert one or more elements at the beginning of an array
Allows to insert multiple elements at once:
Array.unshift(array, e1, e2)
array
(iterable)element
(mixed)
Return (array) The array with the inserted elements
Get the array values
array
(iterable) The array
Return (array)
This is a purely internal helper to provide baseUris for Caching. It will be moved to a more sensible package in the future so do not rely on the classname for now.
Implemented in: Neos\Fusion\Eel\BaseUriHelper
fallbackRequest
(ServerRequestInterface|null, optional)
Return (UriInterface)
Configuration helpers for Eel contexts
Implemented in: Neos\Eel\Helper\ConfigurationHelper
Return the specified settings
Examples:
Configuration.setting('Neos.Flow.core.context') == 'Production'
Configuration.setting('Acme.Demo.speedMode') == 'light speed'
settingPath
(string)
Return (mixed)
Implemented in: Neos\Neos\Ui\Fusion\Helper\ContentDimensionsHelper
dimensions
(array) Dimension values indexed by dimension name
Return (array) Allowed preset names for the given dimension combination indexed by dimension name
Return (array) Dimensions indexed by name with presets indexed by name
Date helpers for Eel contexts
Implemented in: Neos\Eel\Helper\DateHelper
Add an interval to a date and return a new DateTime object
date
(DateTime)interval
(string|DateInterval)
Return (DateTime)
Get a date object by given date or time format
Examples:
Date.create('2018-12-04')
Date.create('first day of next year')
time
(String) A date/time string. For valid formats see http://php.net/manual/en/datetime.formats.php
Return (DateTime)
Get the day of month of a date
dateTime
(DateTimeInterface)
Return (integer) The day of month of the given date
Get the difference between two dates as a DateInterval object
dateA
(DateTime)dateB
(DateTime)
Return (DateInterval)
Format a date (or interval) to a string with a given format
See formatting options as in PHP date()
date
(integerDateTime|DateInterval)format
(string)
Return (string)
Format a date to a string with a given cldr format
date
(integerDateTime)cldrFormat
(string) Format string in CLDR format (see http://cldr.unicode.org/translation/date-time)locale
(nullen|ru_RU)
Return (string)
Get the hour of a date (24 hour format)
dateTime
(DateTimeInterface)
Return (integer) The hour of the given date
Get the minute of a date
dateTime
(DateTimeInterface)
Return (integer) The minute of the given date
Get the month of a date
dateTime
(DateTimeInterface)
Return (integer) The month of the given date
Get the current date and time
Examples:
Date.now().timestamp
Return (DateTime)
Parse a date from string with a format to a DateTime object
string
(string)format
(string)
Return (DateTime)
Get the second of a date
dateTime
(DateTimeInterface)
Return (integer) The second of the given date
Subtract an interval from a date and return a new DateTime object
date
(DateTime)interval
(string|DateInterval)
Return (DateTime)
Get the current date
Return (DateTime)
Get the year of a date
dateTime
(DateTimeInterface)
Return (integer) The year of the given date
Helper to read files.
Implemented in: Neos\Eel\Helper\FileHelper
Check if the given file path exists
filepath
(string)
Return (bool)
Get file name and path information
filepath
(string)
Return (array) with keys dirname, basename, extension (if any), and filename
filepath
(string)
Return (string)
Read and return the files contents for further use.
filepath
(string)
Return (string)
Get file information like creation and modification times as well as size.
filepath
(string)
Return (array) with keys mode, uid, gid, size, atime, mtime, ctime, (blksize, blocks, dev, ino, nlink, rdev)
Implemented in: Neos\Fusion\Form\Runtime\Helper\SchemaHelper
Create an array schema.
Return (SchemaInterface)
Create a date schema for an array by providing a schema for all items
schema
(SchemaInterface) The schema for the items of the array
Return (SchemaInterface)
Create a boolean schema
Return (SchemaInterface)
Create a date schema. The php value will be DateTime
format
(string, optional) The format default is "Y-m-d
Return (SchemaInterface)
Create a float schema
Return (SchemaInterface)
Create a schema for the given type
type
(string) The type or className that is expected
Return (SchemaInterface)
Create a integer schema
Return (SchemaInterface)
Create a resource schema
collection
(string, optional) The collection new resources are put into
Return (SchemaInterface)
Create a string schema
Return (SchemaInterface)
JSON helpers for Eel contexts
Implemented in: Neos\Eel\Helper\JsonHelper
JSON decode the given string
json
(string)associativeArrays
(boolean, optional)
Return (mixed)
JSON encode the given value
Usage example for options:
Json.stringify(value, ['JSON_UNESCAPED_UNICODE', 'JSON_FORCE_OBJECT'])
value
(mixed)options
(array, optional) Array of option constant names as strings
Return (string)
Math helpers for Eel contexts
The implementation sticks to the JavaScript specificiation including EcmaScript 6 proposals.
See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math for a documentation and specification of the JavaScript implementation.
Implemented in: Neos\Eel\Helper\MathHelper
x
(float, optional) A number
Return (float) The absolute value of the given value
x
(float) A number
Return (float) The arccosine (in radians) of the given value
x
(float) A number
Return (float) The hyperbolic arccosine (in radians) of the given value
x
(float) A number
Return (float) The arcsine (in radians) of the given value
x
(float) A number
Return (float) The hyperbolic arcsine (in radians) of the given value
x
(float) A number
Return (float) The arctangent (in radians) of the given value
y
(float) A numberx
(float) A number
Return (float) The arctangent of the quotient of its arguments
x
(float) A number
Return (float) The hyperbolic arctangent (in radians) of the given value
x
(float) A number
Return (float) The cube root of the given value
x
(float) A number
Return (float) The smallest integer greater than or equal to the given value
x
(float) A number given in radians
Return (float) The cosine of the given value
x
(float) A number
Return (float) The hyperbolic cosine of the given value
x
(float) A number
Return (float) The power of the Euler's constant with the given value (e^x)
x
(float) A number
Return (float) The power of the Euler's constant with the given value minus 1 (e^x - 1)
x
(float) A number
Return (float) The largest integer less than or equal to the given value
Return (float) Euler's constant and the base of natural logarithms, approximately 2.718
Return (float) Natural logarithm of 10, approximately 2.303
Return (float) Natural logarithm of 2, approximately 0.693
Return (float) Base 10 logarithm of E, approximately 0.434
Return (float) Base 2 logarithm of E, approximately 1.443
Return (float) Ratio of the circumference of a circle to its diameter, approximately 3.14159
Return (float) Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707
Return (float) Square root of 2, approximately 1.414
x
(float) A numbery
(float) A numberz_
(float, optional) Optional variable list of additional numbers
Return (float) The square root of the sum of squares of the arguments
Test if the given value is a finite number
This is equivalent to the global isFinite() function in JavaScript.
x
(mixed) A value
Return (boolean) true if the value is a finite (not NAN) number
Test if the given value is an infinite number (INF or -INF)
This function has no direct equivalent in JavaScript.
x
(mixed) A value
Return (boolean) true if the value is INF or -INF
Test if the given value is not a number (either not numeric or NAN)
This is equivalent to the global isNaN() function in JavaScript.
x
(mixed) A value
Return (boolean) true if the value is not a number
x
(float) A number
Return (float) The natural logarithm (base e) of the given value
x
(float) A number
Return (float) The base 10 logarithm of the given value
x
(float) A number
Return (float) The natural logarithm (base e) of 1 + the given value
x
(float) A number
Return (float) The base 2 logarithm of the given value
x
(float, optional) A numbery_
(float, optional) Optional variable list of additional numbers
Return (float) The largest of the given numbers (zero or more)
x
(float, optional) A numbery_
(float, optional) Optional variable list of additional numbers
Return (float) The smallest of the given numbers (zero or more)
Calculate the power of x by y
x
(float) The basey
(float) The exponent
Return (float) The base to the exponent power (x^y)
Get a random foating point number between 0 (inclusive) and 1 (exclusive)
That means a result will always be less than 1 and greater or equal to 0, the same way Math.random() works in JavaScript.
See Math.randomInt(min, max) for a function that returns random integer numbers from a given interval.
Return (float) A random floating point number between 0 (inclusive) and 1 (exclusive), that is from [0, 1)
Get a random integer number between a min and max value (inclusive)
That means a result will always be greater than or equal to min and less than or equal to max.
min
(integer) The lower bound for the random number (inclusive)max
(integer) The upper bound for the random number (inclusive)
Return (integer) A random number between min and max (inclusive), that is from [min, max]
Rounds the subject to the given precision
The precision defines the number of digits after the decimal point. Negative values are also supported (-1 rounds to full 10ths).
subject
(mixed) The value to roundprecision
(integer, optional) The precision (digits after decimal point) to use, defaults to 0
Return (float) The rounded value
Get the sign of the given number, indicating whether the number is positive, negative or zero
x
(integer|float) The value
Return (integer) -1, 0, 1 depending on the sign or NAN if the given value was not numeric
x
(float) A number given in radians
Return (float) The sine of the given value
x
(float) A number
Return (float) The hyperbolic sine of the given value
x
(float) A number
Return (float) The square root of the given number
x
(float) A number given in radians
Return (float) The tangent of the given value
x
(float) A number
Return (float) The hyperbolic tangent of the given value
Get the integral part of the given number by removing any fractional digits
This function doesn't round the given number but merely calls ceil(x) or floor(x) depending on the sign of the number.
x
(float) A number
Return (int|float) The integral part of the given number or NAN if the given value was not numeric
Some Functional Programming Array helpers for Eel contexts
These helpers are WORK IN PROGRESS and NOT STABLE YET
Implemented in: Neos\Neos\Fusion\Helper\ArrayHelper
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to true.
set
(array|Collection)filterProperty
(string)
Return (array)
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to false.
set
(array|Collection)filterProperty
(string)
Return (array)
The input is assumed to be an array or Collection of objects. Groups this input by the $groupingKey property of each element.
set
(array|Collection)groupingKey
(string)
Return (array)
Neos.Array.sortByPropertyPath(set, positionPropertyPath) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The input is assumed to be an array. Sorts this input by the $positionPropertyPath property of each element.
set
(array)positionPropertyPath
(string)
Return (array)
BackendUser helper for translations in the backend
Implemented in: Neos\Neos\Fusion\Helper\BackendHelper
The interface language the user selected or the default language defined in the settings Formatted as {@see NeosFlowI18nLocale} identifier, eg "de", "en", ...
Example:
Translation.id("mh").locale(Neos.Backend.interfaceLanguage()).translate()
Return (string)
Caching helper to make cache tag generation easier.
Implemented in: Neos\Neos\Fusion\Helper\CachingHelper
Generate a @cache entry tag for descendants of a node, an array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever a node (for any variant) that is a descendant (child on any level) of one of the given nodes is updated.
nodes
(mixed) (A single Node or array or Traversable of Nodes)
Return (array)
Generate a @cache entry tag for a single node, array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever one of the given nodes (for any variant) is updated.
nodes
(mixed) (A single Node or array or Traversable of Nodes)
Return (array)
Generate a @cache entry tag for a single node identifier. If a NodeInterface $contextNode is given the entry tag will respect the workspace hash.
identifier
(string)contextNode
(NodeInterface|null, optional)
Return (string)
Generate an @cache entry tag for a node type A cache entry with this tag will be flushed whenever a node (for any variant) that is of the given node type(s) (including inheritance) is updated.
nodeType
(stringstring[]|NodeType[])contextNode
(NodeInterface|null, optional)
Return (string|string[])
workspaceName
(string)
Return (string)
Eel helper for the linking service
Implemented in: Neos\Neos\Fusion\Helper\LinkHelper
uri
(string|UriInterface)contextNode
(NodeInterface, optional)
Return (NodeInterfaceNULL)
uri
(string|UriInterface)
Return (string)
uri
(string|UriInterface)
Return (boolean)
uri
(string|UriInterface)
Return (string)
uri
(string|UriInterface)contextNode
(NodeInterface)controllerContext
(ControllerContext)
Return (string)
This is a helper for accessing assets from the media library
Implemented in: Neos\Media\Eel\AssetsHelper
Return (QueryResultInterface<AssetInterface>) | null
Return (QueryResultInterface) | null
tags
(Tag[]|string[], optional)
Return (QueryResultInterface<AssetInterface>) | null
Eel helper for ContentRepository Nodes
Implemented in: Neos\Neos\Fusion\Helper\NodeHelper
If this node type or any of the direct or indirect super types has the given name.
node
(NodeInterface)nodeType
(string)
Return (bool)
Generate a label for a node with a chaining mechanism. To be used in nodetype definitions.
node
(NodeInterface|null, optional)
Return (NodeLabelToken)
Check if the given node is already a collection, find collection by nodePath otherwise, throw exception if no content collection could be found
node
(NodeInterface)nodePath
(string)
Return (NodeInterface)
Render Content Dimension Names, Node Labels
These helpers are WORK IN PROGRESS and NOT STABLE YET
Implemented in: Neos\Neos\Fusion\Helper\RenderingHelper
configurationManager
(ConfigurationManager)
Return (void)
Render the label for the given $nodeTypeName
nodeTypeName
(string)
Return (string)
Render a human-readable description for the passed $dimensions
dimensions
(array)
Return (string)
Implemented in: Neos\Seo\Fusion\Helper\ImageHelper
Neos.Seo.Image.createThumbnail(asset, preset, width, maximumWidth, height, maximumHeight, allowCropping, allowUpScaling, async, quality, format)
asset
(AssetInterface)preset
(string, optional) Name of the preset that should be used as basis for the configurationwidth
(integer, optional) Desired width of the imagemaximumWidth
(integer, optional) Desired maximum width of the imageheight
(integer, optional) Desired height of the imagemaximumHeight
(integer, optional) Desired maximum height of the imageallowCropping
(boolean, optional) Whether the image should be cropped if the given sizes would hurt the aspect ratioallowUpScaling
(boolean, optional) Whether the resulting image size might exceed the size of the original imageasync
(boolean, optional) Whether the thumbnail can be generated asynchronouslyquality
(integer, optional) Quality of the processed imageformat
(string, optional) Format for the image, only jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported.
Return (null|ImageInterface)
Implemented in: Neos\Neos\Ui\Fusion\Helper\PositionalArraySorterHelper
array
(array)positionPath
(string, optional)
Return (array)
Implemented in: Neos\Neos\Ui\Fusion\Helper\StaticResourcesHelper
Implemented in: Neos\Neos\Ui\Fusion\Helper\WorkspaceHelper
workspace
(Workspace)
Return (array)
Implemented in: Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper
Creates a URL that will redirect to the given $node in live or base workspace, or returns an empty string if that doesn't exist or is inaccessible
controllerContext
(ControllerContext)node
(NodeInterface|null, optional)
Return (string)
site
(NodeInterface)documentNode
(NodeInterface)controllerContext
(ControllerContext)
Return (array)
documentNode
(NodeInterface)controllerContext
(ControllerContext)
Return (array)
NodeInfo.renderNodeWithMinimalPropertiesAndChildrenInformation(node, controllerContext, nodeTypeFilterOverride)
node
(NodeInterface)controllerContext
(ControllerContext|null, optional)nodeTypeFilterOverride
(string, optional)
Return (array|null)
NodeInfo.renderNodeWithPropertiesAndChildrenInformation(node, controllerContext, nodeTypeFilterOverride)
node
(NodeInterface)controllerContext
(ControllerContext|null, optional)nodeTypeFilterOverride
(string, optional)
Return (array|null)
nodes
(array)controllerContext
(ControllerContext)omitMostPropertiesForTreeState
(bool, optional)
Return (array)
nodes
(array)controllerContext
(ControllerContext)
Return (array)
node
(NodeInterface)controllerContext
(ControllerContext)
Return (string)
Helper for security related information
Implemented in: Neos\Eel\Helper\SecurityHelper
Returns CSRF token which is required for "unsafe" requests (e.g. POST, PUT, DELETE, ...)
Return (string)
Get the account of the first authenticated token.
Return (Account|NULL)
Returns true, if access to the given privilege-target is granted
privilegeTarget
(string) The identifier of the privilege target to decide onparameters
(array, optional) Optional array of privilege parameters (simple key => value array)
Return (boolean) true if access is granted, false otherwise
Returns true, if at least one of the currently authenticated accounts holds a role with the given identifier, also recursively.
roleIdentifier
(string) The string representation of the role to search for
Return (boolean) true, if a role with the given string representation was found
Returns true, if any account is currently authenticated
Return (boolean) true if any account is authenticated
Implemented in: Neos\Flow\ResourceManagement\EelHelper\StaticResourceHelper
Get the content of a package resource
packageKey
(string) Package key where the resource is from.pathAndFilename
(string) The path and filename of the resource. Starting with "Public/..." or "Private/...localize
(bool, optional) If enabled localizing of the resource is attempted by adding locales from the current locale-chain between filename and extension.
Return (string)
Get the public uri of a package resource
packageKey
(string) Package key where the resource is from.pathAndFilename
(string) The path and filename of the resource. Has to start with "Public/..." as private resources do not have a uri.localize
(bool, optional) If enabled localizing of the resource is attempted by adding locales from the current locale-chain between filename and extension.
Return (string)
String helpers for Eel contexts
Implemented in: Neos\Eel\Helper\StringHelper
Implementation of the PHP base64_decode function
string
(string) The encoded data.strict
(bool, optional) If TRUE this function will return FALSE if the input contains character from outside the base64 alphabet.
Return (string|bool) The decoded data or FALSE on failure. The returned data may be binary.
Implementation of the PHP base64_encode function
string
(string) The data to encode.
Return (string) The encoded data
Get the character at a specific position
Example:
String.charAt("abcdefg", 5) == "f"
string
(string) The input stringindex
(integer) The index to get
Return (string) The character at the given index
Generate a single-byte string from a number
Example:
String.chr(65) == "A"
This is a wrapper for the chr() PHP function.
value
(int) An integer between 0 and 255
Return (string) A single-character string containing the specified byte
Crop a string to maximumCharacters
length, optionally appending suffix
if cropping was necessary.
string
(string) The input stringmaximumCharacters
(integer) Number of characters where cropping should happensuffix
(string, optional) Suffix to be appended if cropping was necessary
Return (string) The cropped string
Crop a string to maximumCharacters
length, taking sentences into account, optionally appending suffix
if cropping was necessary.
string
(string) The input stringmaximumCharacters
(integer) Number of characters where cropping should happensuffix
(string, optional) Suffix to be appended if cropping was necessary
Return (string) The cropped string
Crop a string to maximumCharacters
length, taking words into account, optionally appending suffix
if cropping was necessary.
string
(string) The input stringmaximumCharacters
(integer) Number of characters where cropping should happensuffix
(string, optional) Suffix to be appended if cropping was necessary
Return (string) The cropped string
Test if a string ends with the given search string
Example:
String.endsWith('Hello, World!', 'World!') == true
string
(string) The stringsearch
(string) A string to searchposition
(int|null, optional) Optional position for limiting the string
Return (boolean) true if the string ends with the given search
Lowercase the first letter of a string
Example:
String.firstLetterToLowerCase('CamelCase') == 'camelCase'
string
(string) The input string
Return (string) The string with the first letter in lowercase
Uppercase the first letter of a string
Example:
String.firstLetterToUpperCase('hello world') == 'Hello world'
string
(string) The input string
Return (string) The string with the first letter in uppercase
Implementation of the PHP vsprintf function
format
(string) A formatting string containing directivesargs
(array) An array of values to be inserted according to the formatting string $format
Return (string) A string produced according to the formatting string $format
Convert special characters to HTML entities
string
(string) The string to convertpreserveEntities
(boolean, optional)true
if entities should not be double encoded
Return (string) The converted string
Find the first position of a substring in the given string
Example:
String.indexOf("Blue Whale", "Blue") == 0
string
(string) The input stringsearch
(string) The substring to search forfromIndex
(integer, optional) The index where the search should start, defaults to the beginning
Return (integer) The index of the substring (>= 0) or -1 if the substring was not found
Test if the given string is blank (empty or consists of whitespace only)
Examples:
String.isBlank('') == true
String.isBlank(' ') == true
string
(string) The string to test
Return (boolean) true
if the given string is blank
Find the last position of a substring in the given string
Example:
String.lastIndexOf("Developers Developers Developers!", "Developers") == 22
string
(string) The input stringsearch
(string) The substring to search fortoIndex
(integer, optional) The position where the backwards search should start, defaults to the end
Return (integer) The last index of the substring (>=0) or -1 if the substring was not found
Get the length of a string
string
(string) The input string
Return (integer) Length of the string
Calculate the MD5 checksum of the given string
Example:
String.md5("joh316") == "bacb98acf97e0b6112b1d1b650b84971"
string
(string) The string to hash
Return (string) The MD5 hash of string
Insert HTML line breaks before all newlines in a string
Example:
String.nl2br(someStingWithLinebreaks) == 'line1<br />line2'
This is a wrapper for the nl2br() PHP function.
string
(string) The input string
Return (string) The string with new lines replaced
Convert the first byte of a string to a value between 0 and 255
Example:
String.ord('A') == 65
This is a wrapper for the ord() PHP function.
string
(string) A character
Return (int) An integer between 0 and 255
Match a string with a regular expression (PREG style)
Example:
String.pregMatch("For more information, see Chapter 3.4.5.1", "/(chapter \d+(\.\d)*)/i")
== ['Chapter 3.4.5.1', 'Chapter 3.4.5.1', '.1']
string
(string) The input stringpattern
(string) A PREG pattern
Return (array) The matches as array or NULL if not matched
Perform a global regular expression match (PREG style)
Example:
String.pregMatchAll("<hr id="icon-one" /><hr id="icon-two" />", '/id="icon-(.+?)"/')
== [['id="icon-one"', 'id="icon-two"'],['one','two']]
string
(string) The input stringpattern
(string) A PREG pattern
Return (array) The matches as array or NULL if not matched
Replace occurrences of a search string inside the string using regular expression matching (PREG style)
Examples:
String.pregReplace("Some.String with sp:cial characters", "/[[:^alnum:]]/", "-") == "Some-String-with-sp-cial-characters"
String.pregReplace("Some.String with sp:cial characters", "/[[:^alnum:]]/", "-", 1) == "Some-String with sp:cial characters"
String.pregReplace("2016-08-31", "/([0-9]+)-([0-9]+)-([0-9]+)/", "$3.$2.$1") == "31.08.2016"
string
(string) The input stringpattern
(string) A PREG patternreplace
(string) A replacement string, can contain references to capture groups with "\n" or "$nlimit
(integer, optional) The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).
Return (string) The string with all occurrences replaced
Split a string by a separator using regular expression matching (PREG style)
Examples:
String.pregSplit("foo bar baz", "/\s+/") == ['foo', 'bar', 'baz']
String.pregSplit("first second third", "/\s+/", 2) == ['first', 'second third']
string
(string) The input stringpattern
(string) A PREG patternlimit
(integer, optional) The maximum amount of items to return, in contrast to split() this will return all remaining characters in the last item (see example)
Return (array) An array of the splitted parts, excluding the matched pattern
Decode the string from URLs according to RFC 3986
string
(string) The string to decode
Return (string) The decoded string
Encode the string for URLs according to RFC 3986
string
(string) The string to encode
Return (string) The encoded string
Replace occurrences of a search string inside the string
Example:
String.replace("canal", "ana", "oo") == "cool"
String.replace("cool gridge", ["oo", "gri"], ["ana", "bri"]) == "canal bridge"
Note: this method does not perform regular expression matching, @see pregReplace().
string
(arraynull) The input stringsearch
(arraynull) A search stringreplace
(arraynull) A replacement string
Return (arraystring[]) The string with all occurrences replaced
Calculate the SHA1 checksum of the given string
Example:
String.sha1("joh316") == "063b3d108bed9f88fa618c6046de0dccadcf3158"
string
(string) The string to hash
Return (string) The SHA1 hash of string
Split a string by a separator
Example:
String.split("My hovercraft is full of eels", " ") == ['My', 'hovercraft', 'is', 'full', 'of', 'eels']
String.split("Foo", "", 2) == ['F', 'o']
Node: This implementation follows JavaScript semantics without support of regular expressions.
string
(string) The string to splitseparator
(string|null, optional) The separator where the string should be splittedlimit
(int|null, optional) The maximum amount of items to split (exceeding items will be discarded)
Return (array) An array of the splitted parts, excluding the separators
Test if a string starts with the given search string
Examples:
String.startsWith('Hello world!', 'Hello') == true
String.startsWith('My hovercraft is full of...', 'Hello') == false
String.startsWith('My hovercraft is full of...', 'hovercraft', 3) == true
string
(string) The input stringsearch
(string) The string to search forposition
(integer, optional) The position to test (defaults to the beginning of the string)
Return (boolean)
Strip all HTML tags from the given string
Example:
String.stripTags('<a href="#">Some link</a>') == 'Some link'
This is a wrapper for the strip_tags() PHP function.
string
(string) The string to stripallowableTags
(string|null, optional) Specify tags which should not be stripped
Return (string) The string with tags stripped
Return the characters in a string from start up to the given length
This implementation follows the JavaScript specification for "substr".
Examples:
String.substr('Hello, World!', 7, 5) == 'World'
String.substr('Hello, World!', 7) == 'World!'
String.substr('Hello, World!', -6) == 'World!'
string
(string) A stringstart
(integer) Start offsetlength
(integer, optional) Maximum length of the substring that is returned
Return (string) The substring
Return the characters in a string from a start index to an end index
This implementation follows the JavaScript specification for "substring".
Examples:
String.substring('Hello, World!', 7, 12) == 'World'
String.substring('Hello, World!', 7) == 'World!'
string
(string)start
(integer) Start indexend
(integer, optional) End index
Return (string) The substring
Convert a string to boolean
A value is true
, if it is either the string "true"
or "TRUE"
or the number 1
.
string
(string) The string to convert
Return (boolean) The boolean value of the string (true
or false
)
Convert a string to float
string
(string) The string to convert
Return (float) The float value of the string
Convert a string to integer
string
(string) The string to convert
Return (integer) The converted string
Lowercase a string
string
(string) The input string
Return (string) The string in lowercase
Convert the given value to a string
value
(mixed) The value to convert (must be convertible to string)
Return (string) The string value
Uppercase a string
string
(string) The input string
Return (string) The string in uppercase
Trim whitespace at the beginning and end of a string
string
(string) The string to trimcharlist
(string, optional) List of characters that should be trimmed, defaults to whitespace
Return (string) The trimmed string
Return the count of words for a given string. Remove marks & digits and flatten all kind of whitespaces (tabs, new lines and multiple spaces) For example this helper can be utilized to calculate the reading time of an article.
unicodeString
(string) The input string
Return (integer) Number of words
Translation helpers for Eel contexts
Implemented in: Neos\Flow\I18n\EelHelper\TranslationHelper
Start collection of parameters for translation by id
id
(string) Id to use for finding translation (trans-unit id in XLIFF)
Return (TranslationParameterToken)
Get the translated value for an id or original label
If only id is set and contains a translation shorthand string, translate according to that shorthand
In all other cases:
Replace all placeholders with corresponding values if they exist in the translated label.
id
(string) Id to use for finding translation (trans-unit id in XLIFF)originalLabel
(string, optional) The original translation value (the untranslated source string).arguments
(array, optional) Array of numerically indexed or named values to be inserted into placeholders. Have a look at the internationalization documentation in the definitive guide for details.source
(string, optional) Name of file with translationspackage
(string, optional) Target package key. If not set, the current package key will be usedquantity
(mixed, optional) A number to find plural form for (float or int), NULL to not use plural formslocale
(string, optional) An identifier of locale to use (NULL for use the default locale)
Return (string|null) Translated label or source label / ID key
Start collection of parameters for translation by original label
value
(string)
Return (TranslationParameterToken)
Type helper for Eel contexts
Implemented in: Neos\Eel\Helper\TypeHelper
Get the class name of the given variable or NULL if it wasn't an object
variable
(object)
Return (string|NULL)
Get the classname for objects or type for other values
variable
(mixed)
Return (string)
Get the variable type
variable
(mixed)
Return (string)
Is the given variable of the provided object type.
variable
(mixed)expectedObjectType
(string)
Return (boolean)
Is the given variable an array.
variable
(mixed)
Return (boolean)
Is the given variable boolean.
variable
(mixed)
Return (boolean)
Is the given variable a float.
variable
(mixed)
Return (boolean)
Is the given variable an integer.
variable
(mixed)
Return (boolean)
Is the given variable numeric.
variable
(mixed)
Return (boolean)
Is the given variable an object.
variable
(mixed)
Return (boolean)
Is the given variable a scalar.
variable
(mixed)
Return (boolean)
Is the given variable a string.
variable
(mixed)
Return (boolean)
Get the variable type
variable
(mixed)
Return (string)