ShortcutButton implements ButtonInterface, PositionInterface

ShortcutButton

Renders a shortcut button in the DocHeader which will be rendered to the right position using button group "91".

EXAMPLE USAGE TO ADD A SHORTCUT BUTTON:

$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $pageId = (int)($request->getQueryParams()['id'] ?? 0); $myButton = $buttonBar->makeShortcutButton() ->setRouteIdentifier('page_preview') ->setDisplayName('View page ' . $pageId) ->setArguments([ 'id' => $pageId ]); $buttonBar->addButton($myButton);

Table of Contents

Interfaces

ButtonInterface
Interface for buttons
PositionInterface
Interface for buttons

Properties

$arguments  : array<string|int, mixed>
$copyUrlToClipboard  : bool
$displayName  : string
$routeIdentifier  : string

Methods

__toString()  : string
Renders the button
getDisplayName()  : string
Gets the display name of the module.
getGroup()  : int
Gets the button group.
getPosition()  : string
Gets the button position.
getRouteIdentifier()  : string
Gets the route identifier for the shortcut.
getType()  : string
Gets the type of the button
isValid()  : bool
Determines whether the button shall be rendered.
render()  : string
Renders the button
setArguments()  : $this
setCopyUrlToClipboard()  : $this
Defines whether the shortcut button should be extended to also allow copying the current URL to the operating systems' clipboard.
setDisplayName()  : ShortcutButton
Sets the display name of the module.
setRouteIdentifier()  : self
Sets the route identifier for the shortcut.
getBackendUser()  : BackendUserAuthentication
getDispatchActionAttrs()  : array<string|int, mixed>
Returns HTML attributes for client-side `ActionDispatcher` of the "add shortcut" button.
getLanguageService()  : LanguageService
routeExists()  : bool

Properties

$arguments

protected array<string|int, mixed> $arguments = []

List of parameter/value pairs relevant for this shortcut

$copyUrlToClipboard

protected bool $copyUrlToClipboard = true

$displayName

protected string $displayName = ''

$routeIdentifier

protected string $routeIdentifier = ''

The route identifier of the shortcut

Methods

__toString()

Renders the button

public __toString() : string
Return values
string

getDisplayName()

Gets the display name of the module.

public getDisplayName() : string
Return values
string

getGroup()

Gets the button group.

public getGroup() : int
Return values
int

getPosition()

Gets the button position.

public getPosition() : string
Return values
string

getRouteIdentifier()

Gets the route identifier for the shortcut.

public getRouteIdentifier() : string
Return values
string

getType()

Gets the type of the button

public getType() : string
Return values
string

isValid()

Determines whether the button shall be rendered.

public isValid() : bool
Return values
bool

render()

Renders the button

public render() : string
Return values
string

setArguments()

public setArguments(array<string|int, mixed> $arguments) : $this
Parameters
$arguments : array<string|int, mixed>
Return values
$this

setCopyUrlToClipboard()

Defines whether the shortcut button should be extended to also allow copying the current URL to the operating systems' clipboard.

public setCopyUrlToClipboard(bool $copyUrlToClipboard) : $this
Parameters
$copyUrlToClipboard : bool
Return values
$this

setRouteIdentifier()

Sets the route identifier for the shortcut.

public setRouteIdentifier(string $routeIdentifier) : self
Parameters
$routeIdentifier : string
Return values
self

getDispatchActionAttrs()

Returns HTML attributes for client-side `ActionDispatcher` of the "add shortcut" button.

protected getDispatchActionAttrs(string $routeIdentifier, string $encodedArguments, string $confirmationText) : array<string|int, mixed>
Parameters
$routeIdentifier : string
$encodedArguments : string
$confirmationText : string
Return values
array<string|int, mixed>

routeExists()

protected routeExists(string $routeIdentifier) : bool
Parameters
$routeIdentifier : string
Return values
bool

        
On this page

Search results