PHP Класс Backend\Core\Engine\DataGridFunctions

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$dataGridUsers

Открытые методы

Метод Описание
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

Описание методов

cleanupPlainText() публичный статический Метод

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.
Результат string

formatFloat() публичный статический Метод

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.
Результат string

getDate() публичный статический Метод

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.
Результат string

getLongDate() публичный статический Метод

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.
Результат string

getTime() публичный статический Метод

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.
Результат string

getTimeAgo() публичный статический Метод

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.
Результат string

getUser() публичный статический Метод

Get the HTML for a user to use in a datagrid
public static getUser ( integer $id ) : string
$id integer The Id of the user.
Результат string

greyOut() публичный статический Метод

'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
Результат array

showBool() публичный статический Метод

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
Результат string

showImage() публичный статический Метод

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
Результат string

truncate() публичный статический Метод

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?
Результат string

Описание свойств

$dataGridUsers защищенное статическое свойство

protected static $dataGridUsers