tools
in
FanPress CM internal tools class
Table of Contents
calcSize() | Erzeugt für Wert in $value einen String mit passender Einheit und Anzahl Dezimalstellen von Byte (B) bis Terrabyte/Tebibyte (TB/TiB) | string |
---|---|---|
getControllerLink() | Create controller link | string |
getFullControllerLink() | Create controller link | string |
calcPagination() | Berechnet Werte für Seitennavigation | array |
getPageOffset() | Berechnet Limit anhand von Seite und Limit pro Seite | int |
getNavigationActiveCheckStr() | String zum Setzen des aktuell aktiven Modules in Navigation | string |
escapeFileName() | Escapes filename | string |
getHash() | Create Hash of $data with @see security::defaultHashAlgo | string |
validateDateString() | Validates date string | bool |
strReplaceArray() | Array wrapper for str_replace | array |
Methods
calcSize()
Erzeugt für Wert in $value einen String mit passender Einheit und Anzahl Dezimalstellen von Byte (B) bis Terrabyte/Tebibyte (TB/TiB)
public
static calcSize(
$value :
number
[, $decimals :
int
= 2 ]
[, $delimDec :
string
= ',' ]
[, $delimTousands :
string
= '.' ]
)
: string
Parameters
- $value : number
ein numerischer Wert
- $decimals : int = 2
Anzahl Dezimalstellen, Default = 2
- $delimDec : string = ','
Dezimal-Trennzeichen
- $delimTousands : string = '.'
Tausender-Trennzeichen
Tags
Return values
stringgetControllerLink()
Create controller link
public
static getControllerLink(
[ $controller :
string
= '' ]
[, $params :
array
= [] ]
)
: string
Parameters
- $controller : string = ''
- $params : array = []
Tags
Return values
stringgetFullControllerLink()
Create controller link
public
static getFullControllerLink(
[ $controller :
string
= '' ]
[, $params :
array
= [] ]
)
: string
Parameters
- $controller : string = ''
- $params : array = []
Tags
Return values
stringcalcPagination()
Berechnet Werte für Seitennavigation
public
static calcPagination(
$pageLimit :
int
, $currentPage :
int
, $maxItemCount :
int
, $currentItemCount :
int
)
: array
Parameters
- $pageLimit : int
- $currentPage : int
- $maxItemCount : int
- $currentItemCount : int
Tags
Return values
arraygetPageOffset()
Berechnet Limit anhand von Seite und Limit pro Seite
public
static getPageOffset(
$page :
int
, $pageLimit :
int
)
: int
Parameters
- $page : int
- $pageLimit : int
Tags
Return values
intgetNavigationActiveCheckStr()
String zum Setzen des aktuell aktiven Modules in Navigation
public
static getNavigationActiveCheckStr(
)
: string
Tags
Return values
stringescapeFileName()
Escapes filename
public
static escapeFileName(
$filename :
string
)
: string
Parameters
- $filename : string
Return values
stringgetHash()
Create Hash of $data with @see security::defaultHashAlgo
public
static getHash(
$data :
string
)
: string
Parameters
- $data : string
Return values
stringvalidateDateString()
Validates date string
public
static validateDateString(
$str :
string
)
: bool
Parameters
- $str : string
Tags
Return values
boolstrReplaceArray()
Array wrapper for str_replace
public
static strReplaceArray(
$subject :
string
, $replacement :
array
[, &$count :
int
= NULL ]
)
: array
Parameters
- $subject : string
- $replacement : array
- $count : int = NULL