PHP Class Venturecraft\Revisionable\FieldFormatter

Afficher le fichier Open project: venturecraft/revisionable Class Usage Examples

Méthodes publiques

Méthode Description
boolean ( $value, array $options = null ) : string Boolean.
datetime ( string $value, string $format = 'Y-m-d H:i:s' ) : formatted Format the datetime
format ( $key, $value, $formats ) : string Format the value according to the provided formats.
isEmpty ( $value, array $options = [] ) : string Check if a field is empty.
string ( $value, $format = null ) : formatted Format the string response, default is to just return the string.

Method Details

boolean() public static méthode

Boolean.
public static boolean ( $value, array $options = null ) : string
$value
$options array The false / true values to return
Résultat string Formatted version of the boolean field

datetime() public static méthode

Format the datetime
public static datetime ( string $value, string $format = 'Y-m-d H:i:s' ) : formatted
$value string
$format string
Résultat formatted datetime

format() public static méthode

Format the value according to the provided formats.
public static format ( $key, $value, $formats ) : string
$key
$value
$formats
Résultat string formatted value

isEmpty() public static méthode

Check if a field is empty.
public static isEmpty ( $value, array $options = [] ) : string
$value
$options array
Résultat string

string() public static méthode

Format the string response, default is to just return the string.
public static string ( $value, $format = null ) : formatted
$value
$format
Résultat formatted string