Class rex_formatter

String formatter class.

Abstract
Package: redaxo\core
Located at redaxo/src/core/lib/util/formatter.php

Methods summary

public static string
# format( string $value, string $formatType, mixed $format )

Formats a string by the given format type.

public static string
# date( string $value, string $format = '' )

Formats a string by date().

public static string
# strftime( string $value, string $format = '' )

Formats a string by strftime().

public static string
# number( string $value, array $format = [] )

Formats a string by number_format().

public static string
# bytes( string $value, array $format = [] )

Formats a string as bytes.

public static string
# sprintf( string $value, string $format = '' )

Formats a string by sprintf().

public static string
# nl2br( string $value )

Formats a string by nl2br.

public static string
# truncate( string $value, array $format = [] )

Truncates a string.

public static string
# widont( string $value )

Avoid widows in a string.

public static string
# version( string $value, string $format )

Formats a version string by sprintf().

public static string
# url( string $value, array $format = [] )

Formats a string as link.

public static string
# email( string $value, array $format = [] )

Formats a string as email link.

public static string
# custom( string $value, callable|array $format )

Formats a string by a custom callable.