class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionProvider, GridField_URLHandler (View source)

Adds an "Print" button to the bottom or top of a GridField.

Properties

protected array $printColumns
protected bool $printHasHeader
protected string $targetFragment

Fragment to write the button to.

Methods

public
__construct(string $targetFragment = "after", array $printColumns = null)

No description

public
array
getHTMLFragments($gridField)

Place the print button in a

tag below the field

public
array
getActions($gridField)

Print is an action button.

public
handleAction(GridField $gridField, $actionName, $arguments, $data)

Handle the print action.

public
getURLHandlers($gridField)

Print is accessible via the url

public
handlePrint($gridField, $request = null)

Handle the print, for both the action button and the URL

protected
array
getPrintColumnsForGridField(GridField $gridField)

Return the columns to print

public
array
getTitle(GridField $gridField)

Return the title of the printed page

public
generatePrintData(GridField $gridField)

Export core.

public
array
getPrintColumns()

No description

public
setPrintColumns($cols)

No description

public
bool
getPrintHasHeader()

No description

public
setPrintHasHeader($bool)

No description

Details

__construct(string $targetFragment = "after", array $printColumns = null)

No description

Parameters

string $targetFragment

The HTML fragment to write the button into

array $printColumns

The columns to include in the print view

array getHTMLFragments($gridField)

Place the print button in a

tag below the field

Parameters

$gridField

Return Value

array

array getActions($gridField)

Print is an action button.

Parameters

$gridField

Return Value

array

with action identifier strings.

handleAction(GridField $gridField, $actionName, $arguments, $data)

Handle the print action.

Parameters

GridField $gridField
$actionName
$arguments
$data

getURLHandlers($gridField)

Print is accessible via the url

Parameters

$gridField

handlePrint($gridField, $request = null)

Handle the print, for both the action button and the URL

Parameters

$gridField
$request

protected array getPrintColumnsForGridField(GridField $gridField)

Return the columns to print

Parameters

GridField $gridField

Return Value

array

array getTitle(GridField $gridField)

Return the title of the printed page

Parameters

GridField $gridField

Return Value

array

generatePrintData(GridField $gridField)

Export core.

Parameters

GridField $gridField

array getPrintColumns()

No description

Return Value

array

setPrintColumns($cols)

No description

Parameters

$cols

bool getPrintHasHeader()

No description

Return Value

bool

setPrintHasHeader($bool)

No description

Parameters

$bool