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
stringgetDisplayName()
Gets the display name of the module.
public
getDisplayName() : string
Return values
stringgetGroup()
Gets the button group.
public
getGroup() : int
Return values
intgetPosition()
Gets the button position.
public
getPosition() : string
Return values
stringgetRouteIdentifier()
Gets the route identifier for the shortcut.
public
getRouteIdentifier() : string
Return values
stringgetType()
Gets the type of the button
public
getType() : string
Return values
stringisValid()
Determines whether the button shall be rendered.
public
isValid() : bool
Return values
boolrender()
Renders the button
public
render() : string
Return values
stringsetArguments()
public
setArguments(array<string|int, mixed> $arguments) : $this
Parameters
- $arguments : array<string|int, mixed>
Return values
$thissetCopyUrlToClipboard()
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
$thissetDisplayName()
Sets the display name of the module.
public
setDisplayName(string $displayName) : ShortcutButton
Parameters
- $displayName : string
Return values
ShortcutButtonsetRouteIdentifier()
Sets the route identifier for the shortcut.
public
setRouteIdentifier(string $routeIdentifier) : self
Parameters
- $routeIdentifier : string
Return values
selfgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDispatchActionAttrs()
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>getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicerouteExists()
protected
routeExists(string $routeIdentifier) : bool
Parameters
- $routeIdentifier : string