Description
Convert a string into the PHP representation.
Examples
[% $date = convert("2022-02-18", datatype: "date"); %]
[% $date = convert("18.02.2022", datatype: "date", format: "d.m.Y"); %]
[% $weight = convert("1221", datatype: "integer"); %]
[% $price = convert("3.14", datatype: "decimal"); %]
[% $duration = convert("PT45M", datatype: "duration"); %]
|
Parameters3
Coding name |
string
|
Description |
The string to be converted.
|
Position |
1
|
Type |
|
Introduced in |
Topincs 9.0.0
|
Coding name |
datatype
|
Description |
The datatype of the string to be converted. Determines the type of PHP representation.
|
Position |
2
|
Type |
datatype(Custom type)
|
Default value |
string.
|
Coding name |
format
|
Description |
The format, if supported by the datatype.
|
Position |
3
|
Type |
String(Primitive type)
|
Default value |
For date: Y-m-d
For time: h:i:s
For datetime: Y-m-d h:i:s
|
Comments |
For boolean:
* %true%: 1
* %false%: 0
|
|