variable.convert

Convert ViewHelper

Converts $value to $type which can be one of ‘string’, ‘integer’, ‘float’, ‘boolean’, ‘array’ or ‘ObjectStorage’. If $value is NULL sensible defaults are assigned or $default which obviously has to be of $type as well.

Arguments

value

DataType
mixed
Required
false
Description
Value to convert into a different type

type

DataType
string
Required
false
Description
Data type to convert the value into. Can be one of “string”, “integer”, “float”, “boolean”, “array” or “ObjectStorage”.

default

DataType
mixed
Required
false
Description
Optional default value to assign to the converted variable in case it is NULL.