CoolCMS API

GroupAction
in package

Action over records marked by a checkbox (buttons in the table footer).

Processing is done by a callback function (array $ids): void; the delete action without a callback uses the built-in delete through the grid manager.

Plain configuration object: GroupAction::create('delete')->setLabel(…)->….

Table of Contents

Properties

$callback  : callable|null
$confirm  : string|null
$icon  : string|null
$label  : string
$name  : string
$privilege  : string|null
$variant  : string
$visibleInPickerMode  : bool

Methods

__construct()  : mixed
create()  : static
getCallback()  : callable|null
getConfirm()  : string|null
getIcon()  : string|null
getLabel()  : string
getName()  : string
getPrivilege()  : string|null
getVariant()  : string
isVisibleInPickerMode()  : bool
setCallback()  : static
setConfirm()  : static
setIcon()  : static
setLabel()  : static
setPrivilege()  : static
Privilege action (suffix) that governs this group action, e.g. `del`, `export`.
setVariant()  : static
showInPickerMode()  : static

Properties

$callback

protected callable|null $callback = null

function (array $ids): void

$visibleInPickerMode

protected bool $visibleInPickerMode = false

Methods

__construct()

public final __construct(string $name) : mixed
Parameters
$name : string

create()

public static create(string $name) : static
Parameters
$name : string
Return values
static

getCallback()

public getCallback() : callable|null
Return values
callable|null

getConfirm()

public getConfirm() : string|null
Return values
string|null

getIcon()

public getIcon() : string|null
Return values
string|null

getLabel()

public getLabel() : string
Return values
string

getName()

public getName() : string
Return values
string

getPrivilege()

public getPrivilege() : string|null
Return values
string|null

getVariant()

public getVariant() : string
Return values
string

isVisibleInPickerMode()

public isVisibleInPickerMode() : bool
Return values
bool

setCallback()

public setCallback(callable $callback) : static
Parameters
$callback : callable

function (array $ids): void

Return values
static

setConfirm()

public setConfirm(string|null $confirm) : static
Parameters
$confirm : string|null
Return values
static

setIcon()

public setIcon(string|null $icon) : static
Parameters
$icon : string|null
Return values
static

setLabel()

public setLabel(string $label) : static
Parameters
$label : string
Return values
static

setPrivilege()

Privilege action (suffix) that governs this group action, e.g. `del`, `export`.

public setPrivilege(string|null $privilege) : static

The grid composes the full key from the presenter: :Admin:<Module>:<Presenter>:<action>. Without the privilege the button is not rendered and the submit ends with 403.

NOTE: delete needs no privilege setting, it has one built in (del), see DataGrid::groupActionPrivilege(). This is for actions with their own callback whose name differs from the privilege (exportXml → export).

Parameters
$privilege : string|null
Return values
static

setVariant()

public setVariant(string $variant) : static
Parameters
$variant : string
Return values
static

showInPickerMode()

public showInPickerMode() : static
Return values
static
On this page

Search results