This method will call one of the "as" methods available in this class to do the formatting.
For type "xyz", the method "asXyz" will be used. For example, if the format is "html",
then Formatter::asHtml will be used. Format names are case insensitive.
public format ( mixed $value, string | array $format ) : string | ||
$value | mixed | the value to be formatted. |
$format | string | array | the format of the value, e.g., "html", "text". To specify additional parameters of the formatting method, you may use an array. The first element of the array specifies the format name, while the rest of the elements will be used as the parameters to the formatting method. For example, a format of `['date', 'Y-m-d']` will cause the invocation of `asDate($value, 'Y-m-d')`. |
return | string | the formatting result. |