ClearCacheToolbarItem

class \TYPO3\CMS\Backend\Backend\ToolbarItems\ClearCacheToolbarItem

Implements
ToolbarItemInterface, RequestAwareToolbarItemInterface

Render cache clearing toolbar item.

Adds a dropdown if there are more than one item to clear (usually for admins to render the flush all caches). The dropdown items can be manipulated using ModifyClearCacheActionsEvent.

Tags

phpstan-type

CacheAction array{ id: non-empty-string, endpoint: non-empty-string, iconIdentifier: non-empty-string, title: non-empty-string, description?: non-empty-string, severity?: 'notice'|'info'|'succcess'|'warning'|'error'|'danger', }

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Interfaces

ToolbarItemInterface
Interface for classes which extend the backend by adding items to the top toolbar
RequestAwareToolbarItemInterface
Interface for toolbar items that need the ServerRequestInterface Request.

Properties

$cacheActions  : array<int, CacheAction>
$optionValues  : array<int, non-empty-string>

Methods

__construct()  : mixed
checkAccess()  : bool
Checks whether the user has access to this toolbar item.
getAdditionalAttributes()  : array
No additional attributes needed.
getDropDown()  : string
Render drop-down.
getIndex()  : int
Position relative to others
getItem()  : string
Render clear cache icon, based on the option if there is more than one icon or just one.
hasDropDown()  : bool
This item has a drop-down, if there is more than one cache action available for the current Backend user.
setRequest()  : void
getBackendUser()  : BackendUserAuthentication

Properties

$cacheActions

protected array<int, CacheAction> $cacheActions = []

$optionValues

protected array<int, non-empty-string> $optionValues = []

Methods

checkAccess()

Checks whether the user has access to this toolbar item.

public checkAccess() : bool

Return values

bool —

TRUE if user has access, FALSE if not

getAdditionalAttributes()

No additional attributes needed.

public getAdditionalAttributes() : array

Return values

array —

List item HTML attributes

getDropDown()

Render drop-down.

public getDropDown() : string

Return values

string —

Drop down HTML

getIndex()

Position relative to others

public getIndex() : int

Return values

int —

0 .. 100

getItem()

Render clear cache icon, based on the option if there is more than one icon or just one.

public getItem() : string

Return values

string —

Toolbar item HTML

hasDropDown()

This item has a drop-down, if there is more than one cache action available for the current Backend user.

public hasDropDown() : bool

Return values

bool

setRequest()

public setRequest(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface
On this page