PHP Class JBZoo\SimpleTypes\Formatter

Afficher le fichier Open project: jbzoo/simpletypes Class Usage Examples

Protected Properties

Свойство Type Description
$_default array
$_rules array
$_type string | null

Méthodes publiques

Méthode Description
__construct ( array $rules = [], array $default = [], string $type = null )
addRule ( string $rule, array $newFormat = [] )
changeRule ( string $rule, array $newFormat )
get ( string $rule ) : array
getList ( boolean $keysOnly = false ) : array
html ( array $current, array $orig, array $params ) : string
htmlAttributes ( array $attributes ) : string
htmlInput ( array $current, array $orig, array $params ) : string
removeRule ( string $rule ) : boolean
round ( float $value, string $rule, array $params = [] ) : float
text ( float $value, string $rule, boolean $showSymbol = true ) : mixed | string

Méthodes protégées

Méthode Description
_format ( float $value, string $rule ) : array Convert value to money format from config

Method Details

__construct() public méthode

public __construct ( array $rules = [], array $default = [], string $type = null )
$rules array
$default array
$type string

_format() protected méthode

Convert value to money format from config
protected _format ( float $value, string $rule ) : array
$value float
$rule string
Résultat array

addRule() public méthode

public addRule ( string $rule, array $newFormat = [] )
$rule string
$newFormat array

changeRule() public méthode

public changeRule ( string $rule, array $newFormat )
$rule string
$newFormat array

get() public méthode

public get ( string $rule ) : array
$rule string
Résultat array

getList() public méthode

public getList ( boolean $keysOnly = false ) : array
$keysOnly boolean
Résultat array

html() public méthode

public html ( array $current, array $orig, array $params ) : string
$current array
$orig array
$params array
Résultat string

htmlAttributes() public méthode

public htmlAttributes ( array $attributes ) : string
$attributes array
Résultat string

htmlInput() public méthode

public htmlInput ( array $current, array $orig, array $params ) : string
$current array
$orig array
$params array
Résultat string

removeRule() public méthode

public removeRule ( string $rule ) : boolean
$rule string
Résultat boolean

round() public méthode

public round ( float $value, string $rule, array $params = [] ) : float
$value float
$rule string
$params array
Résultat float

text() public méthode

public text ( float $value, string $rule, boolean $showSymbol = true ) : mixed | string
$value float
$rule string
$showSymbol boolean
Résultat mixed | string

Property Details

$_default protected_oe property

protected array $_default
Résultat array

$_rules protected_oe property

protected array $_rules
Résultat array

$_type protected_oe property

protected string|null $_type
Résultat string | null