Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getIconBuilder example
$icon
=
[
]
;
if
(
$icon_path
=
$this
->
getIconPath
(
)
)
{
$icon
=
[
'#theme' => 'image',
'#uri' =>
$icon_path
,
'#width' =>
$width
,
'#height' =>
$height
,
'#alt' =>
$this
->
getLabel
(
)
,
]
;
}
elseif
(
$icon_map
=
$this
->
getIconMap
(
)
)
{
$icon_builder
=
$this
->
getIconBuilder
(
)
->
setId
(
$this
->
id
(
)
)
->
setLabel
(
$this
->
getLabel
(
)
)
->
setWidth
(
$width
)
->
setHeight
(
$height
)
;
if
(
$padding
)
{
$icon_builder
->
setPadding
(
$padding
)
;
}
if
(
$stroke_width
)
{
$icon_builder
->
setStrokeWidth
(
$stroke_width
)
;
}
$icon
=
$icon_builder
->
build
(
$icon_map
)
;
}