PHP Class Backend\Core\Engine\DataGridFunctions

Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Protected Properties

Свойство Type Description
$dataGridUsers

Méthodes publiques

Méthode Description
cleanupPlainText ( string $var ) : string Formats plain text as HTML, links will be detected, paragraphs will be inserted
formatFloat ( float $number, integer $decimals = 2 ) : string Format a number as a float
getDate ( integer $timestamp ) : string Format a date according the users' settings
getLongDate ( integer $timestamp ) : string Format a date as a long representation according the users' settings
getTime ( integer $timestamp ) : string Format a time according the users' settings
getTimeAgo ( integer $timestamp ) : string Get time ago as a string for use in a datagrid
getUser ( integer $id ) : string Get the HTML for a user to use in a datagrid
greyOut ( string $type, string $value, array $attributes = [] ) : array This will grey out certain rows from common columns. These columns are:
showBool ( string | boolean $status, boolean $reverse = false ) : string This is an alias for the template modifier since it can also be used here and people didn't find it.
showImage ( string $path, string $image, string $title = '', string $url = null, integer $width = null, integer $height = null ) : string Returns an image tag
truncate ( string $string, integer $length, boolean $useHellip = true ) : string Truncate a string

Method Details

cleanupPlainText() public static méthode

Formats plain text as HTML, links will be detected, paragraphs will be inserted
public static cleanupPlainText ( string $var ) : string
$var string The data to cleanup.
Résultat string

formatFloat() public static méthode

Format a number as a float
public static formatFloat ( float $number, integer $decimals = 2 ) : string
$number float The number to format.
$decimals integer The number of decimals.
Résultat string

getDate() public static méthode

Format a date according the users' settings
public static getDate ( integer $timestamp ) : string
$timestamp integer The UNIX-timestamp to format as a human readable date.
Résultat string

getLongDate() public static méthode

Format a date as a long representation according the users' settings
public static getLongDate ( integer $timestamp ) : string
$timestamp integer The UNIX-timestamp to format as a human readable date.
Résultat string

getTime() public static méthode

Format a time according the users' settings
public static getTime ( integer $timestamp ) : string
$timestamp integer The UNIX-timestamp to format as a human readable time.
Résultat string

getTimeAgo() public static méthode

Get time ago as a string for use in a datagrid
public static getTimeAgo ( integer $timestamp ) : string
$timestamp integer The UNIX-timestamp to convert in a time-ago-string.
Résultat string

getUser() public static méthode

Get the HTML for a user to use in a datagrid
public static getUser ( integer $id ) : string
$id integer The Id of the user.
Résultat string

greyOut() public static méthode

'visible', 'hidden', 'active', 'published'
public static greyOut ( string $type, string $value, array $attributes = [] ) : array
$type string The type of column. This is given since some columns can have different meanings than others.
$value string
$attributes array
Résultat array

showBool() public static méthode

This is an alias for the template modifier since it can also be used here and people didn't find it.
public static showBool ( string | boolean $status, boolean $reverse = false ) : string
$status string | boolean
$reverse boolean show the opposite of the status
Résultat string

showImage() public static méthode

Returns an image tag
public static showImage ( string $path, string $image, string $title = '', string $url = null, integer $width = null, integer $height = null ) : string
$path string The path to the image.
$image string The filename of the image.
$title string The title (will be used as alt).
$url string The url
$width integer The width for the
$height integer The height for the
Résultat string

truncate() public static méthode

Truncate a string
public static truncate ( string $string, integer $length, boolean $useHellip = true ) : string
$string string The string to truncate.
$length integer The maximumlength for the string.
$useHellip boolean Should a hellip be appended?
Résultat string

Property Details

$dataGridUsers protected_oe static_oe property

protected static $dataGridUsers