PHP Class Ublaboo\DataGrid\Column\Action

Inheritance: extends Column
Show file Open project: ublaboo/datagrid Class Usage Examples

Public Properties

Property Type Description
$data_confirm_attribute_name string

Protected Properties

Property Type Description
$attributes array
$class string | callable
$confirm array | callable
$data_attributes array
$grid Ublaboo\DataGrid\DataGrid
$href string
$icon string | callable
$name string
$parameters array
$params array

Public Methods

Method Description
__construct ( DataGrid $grid, string $href, string $name, array $params )
addAttributes ( array $attrs ) : static Set attributes for a element
addParameters ( array $parameters ) : static Add parameters to link
getClass ( Row $row ) : string Get attribute class
getConfirm ( Row $row ) : string Get confirm dialog for particular row item
getIcon ( Row $row ) : string Get icon
getPropertyStringOrCallableGetString ( Row $row, string | callable | null $property, string $name ) : string Check whether given property is string or callable in that case call callback and check property and return it
getTitle ( Row $row ) : string Get attribute title
render ( Row $row ) : mixed Render row item into template
setClass ( string | callable $class ) : static Set attribute class
setConfirm ( string | callable $message, string $column = NULL ) : static Set confirm dialog
setDataAttribute ( string $key, mixed $value ) : static Setting data attributes
setIcon ( string | callable $icon ) : static | callable Set icon
setTitle ( string | callable $title ) : static Set attribute title

Protected Methods

Method Description
checkPropertyStringOrCallable ( mixed $property, $name ) : void Check whether given property is string or callable
translate ( string $message ) : string Translator helper

Method Details

__construct() public method

public __construct ( DataGrid $grid, string $href, string $name, array $params )
$grid Ublaboo\DataGrid\DataGrid
$href string
$name string
$params array

addAttributes() public method

Set attributes for a element
public addAttributes ( array $attrs ) : static
$attrs array
return static

addParameters() public method

Add parameters to link
public addParameters ( array $parameters ) : static
$parameters array
return static

checkPropertyStringOrCallable() protected method

Check whether given property is string or callable
protected checkPropertyStringOrCallable ( mixed $property, $name ) : void
$property mixed
return void

getClass() public method

Get attribute class
public getClass ( Row $row ) : string
$row Ublaboo\DataGrid\Row
return string

getConfirm() public method

Get confirm dialog for particular row item
public getConfirm ( Row $row ) : string
$row Ublaboo\DataGrid\Row
return string

getIcon() public method

Get icon
public getIcon ( Row $row ) : string
$row Ublaboo\DataGrid\Row
return string

getPropertyStringOrCallableGetString() public method

Check whether given property is string or callable in that case call callback and check property and return it
public getPropertyStringOrCallableGetString ( Row $row, string | callable | null $property, string $name ) : string
$row Ublaboo\DataGrid\Row
$property string | callable | null
$name string
return string

getTitle() public method

Get attribute title
public getTitle ( Row $row ) : string
$row Ublaboo\DataGrid\Row
return string

render() public method

Render row item into template
public render ( Row $row ) : mixed
$row Ublaboo\DataGrid\Row
return mixed

setClass() public method

Set attribute class
public setClass ( string | callable $class ) : static
$class string | callable
return static

setConfirm() public method

Set confirm dialog
public setConfirm ( string | callable $message, string $column = NULL ) : static
$message string | callable
$column string
return static

setDataAttribute() public method

Setting data attributes
public setDataAttribute ( string $key, mixed $value ) : static
$key string
$value mixed
return static

setIcon() public method

Set icon
public setIcon ( string | callable $icon ) : static | callable
$icon string | callable
return static | callable

setTitle() public method

Set attribute title
public setTitle ( string | callable $title ) : static
$title string | callable
return static

translate() protected method

Translator helper
protected translate ( string $message ) : string
$message string
return string

Property Details

$attributes protected property

protected array $attributes
return array

$class protected property

protected string|callable $class
return string | callable

$confirm protected property

protected array|callable $confirm
return array | callable

$data_attributes protected property

protected array $data_attributes
return array

$data_confirm_attribute_name public static property

public static string $data_confirm_attribute_name
return string

$grid protected property

protected DataGrid,Ublaboo\DataGrid $grid
return Ublaboo\DataGrid\DataGrid

$href protected property

protected string $href
return string

$icon protected property

protected string|callable $icon
return string | callable

$name protected property

protected string $name
return string

$parameters protected property

protected array $parameters
return array

$params protected property

protected array $params
return array