Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
toKebabCase example
$defs
=
new
SVGDefs
(
)
;
foreach
(
$this
->
getChildren
(
$svg
->
getDocument
(
)
)
as
$child
)
{
$svg
->
getDocument
(
)
->
removeChild
(
$child
)
;
$defs
->
addChild
(
$child
)
;
}
$svg
->
getDocument
(
)
->
addChild
(
$defs
)
;
}
$child
=
$defs
->
getChild
(
0
)
;
if
(
$child
->
getAttribute
(
'id'
)
=== null ||
$cleanup
)
{
$id
= 'icons-' .
$package
. '-' . self::
toKebabCase
(
basename
(
$file
, '.svg'
)
)
;
$child
->
setAttribute
(
'id',
$id
)
;
}
else
{
$id
=
$child
->
getAttribute
(
'id'
)
;
}
$use
= null;
foreach
(
$this
->
getChildren
(
$svg
->
getDocument
(
)
)
as
$child
)
{
if
(
$child
instanceof SVGUse
)
{
$use
=
$child
;
}
}