rex_formatter::format PHP Method

format() public static method

Formats a string by the given format type.
public static format ( string $value, string $formatType, mixed $format ) : string
$value string Value
$formatType string Format type (any method name of this class)
$format mixed For possible values look at the other methods of this class
return string
    public static function format($value, $formatType, $format)
    {
        if (!is_callable([__CLASS__, $formatType])) {
            throw new InvalidArgumentException('Unknown $formatType: "' . $formatType . '"!');
        }
        return self::$formatType($value, $format);
    }

Usage Example

コード例 #1
0
 function formatValue()
 {
     $value = $this->getValue();
     $format_type = $this->getFormatType();
     if ($format_type != '') {
         $value = rex_formatter::format($value, $format_type, $this->getFormat());
     }
     return $value;
 }
All Usage Examples Of rex_formatter::format