Icon

Icon object, holds all information for one icon, identified by the "identifier" property.

Is available to render itself as string.

Table of Contents

Constants

SIZE_DEFAULT  = 'default'
SIZE_LARGE  = 'large'
SIZE_MEDIUM  = 'medium'
SIZE_MEGA  = 'mega'
SIZE_OVERLAY  = 'overlay'
SIZE_SMALL  = 'small'

Properties

$alternativeMarkups  : array<string|int, mixed>
$dimension  : Dimension
$identifier  : string
The identifier which the PHP code that calls the IconFactory hands over
$markup  : string
$overlayIcon  : Icon|null
The identifier for a possible overlay icon
$size  : IconSize
Contains the size string ("large", "small" or "default")
$spinning  : bool
Flag to indicate if the icon has a spinning animation
$state  : IconState|null
Contains the state information
$title  : string|null
The title rendered to the icon

Methods

__toString()  : string
getAlternativeMarkup()  : string
getDimension()  : Dimension
getIdentifier()  : string
getMarkup()  : string
getOverlayIcon()  : Icon|null
getSize()  : string
getState()  : IconState
getTitle()  : string|null
isSpinning()  : bool
render()  : string
setAlternativeMarkup()  : $this
setIdentifier()  : $this
setMarkup()  : $this
setOverlayIcon()  : $this
setSize()  : self
Sets the size and creates the new dimension
setSpinning()  : $this
setState()  : $this
setTitle()  : $this
wrappedIcon()  : string
Wrap icon markup in unified HTML code

Constants

SIZE_DEFAULT

Deprecated

Use TYPO3\CMS\Core\Imaging\IconSize::DEFAULT instead

public string SIZE_DEFAULT = 'default'

the default size

SIZE_LARGE

Deprecated

Use TYPO3\CMS\Core\Imaging\IconSize::LARGE instead

public string SIZE_LARGE = 'large'

the large size

SIZE_MEDIUM

Deprecated

Use TYPO3\CMS\Core\Imaging\IconSize::MEDIUM instead

public string SIZE_MEDIUM = 'medium'

the default size

SIZE_MEGA

Deprecated

Use TYPO3\CMS\Core\Imaging\IconSize::MEGA instead

public string SIZE_MEGA = 'mega'

the mega size

SIZE_OVERLAY

public string SIZE_OVERLAY = 'overlay'

the overlay size, which depends on icon size

Internal

SIZE_SMALL

Deprecated

Use TYPO3\CMS\Core\Imaging\IconSize::SMALL instead

public string SIZE_SMALL = 'small'

the small size

Properties

$alternativeMarkups

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

$identifier

The identifier which the PHP code that calls the IconFactory hands over

protected string $identifier

$overlayIcon

The identifier for a possible overlay icon

protected Icon|null $overlayIcon = null

$size

Contains the size string ("large", "small" or "default")

protected IconSize $size

$spinning

Flag to indicate if the icon has a spinning animation

protected bool $spinning = false

$title

The title rendered to the icon

protected string|null $title = null

Methods

__toString()

public __toString() : string
Return values
string

getAlternativeMarkup()

public getAlternativeMarkup(string $markupIdentifier) : string
Parameters
$markupIdentifier : string
Return values
string

getIdentifier()

public getIdentifier() : string
Return values
string

getMarkup()

public getMarkup([string|null $alternativeMarkupIdentifier = null ]) : string
Parameters
$alternativeMarkupIdentifier : string|null = null
Internal

this method is used for internal processing, to get the prepared and final markup use render()

Return values
string

getSize()

public getSize() : string
Return values
string

getTitle()

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

isSpinning()

public isSpinning() : bool
Return values
bool

render()

public render([string|null $alternativeMarkupIdentifier = null ]) : string
Parameters
$alternativeMarkupIdentifier : string|null = null
Return values
string

setAlternativeMarkup()

public setAlternativeMarkup(string $markupIdentifier, string $markup) : $this
Parameters
$markupIdentifier : string
$markup : string
Return values
$this

setIdentifier()

public setIdentifier(string $identifier) : $this
Parameters
$identifier : string
Return values
$this

setMarkup()

public setMarkup(string $markup) : $this
Parameters
$markup : string
Return values
$this

setOverlayIcon()

public setOverlayIcon(Icon|null $overlayIcon) : $this
Parameters
$overlayIcon : Icon|null
Return values
$this

setSize()

Sets the size and creates the new dimension

public setSize(string|IconSize $size) : self
Parameters
$size : string|IconSize
Tags
todo:

Change $size to allow IconSize only in v14

Return values
self

setSpinning()

public setSpinning(bool $spinning) : $this
Parameters
$spinning : bool
Return values
$this

setTitle()

public setTitle(string|null $title) : $this
Parameters
$title : string|null
Return values
$this

wrappedIcon()

Wrap icon markup in unified HTML code

protected wrappedIcon([string|null $alternativeMarkupIdentifier = null ]) : string
Parameters
$alternativeMarkupIdentifier : string|null = null
Return values
string

        
On this page

Search results