You are a developer and looking for Shopware projects?
Apply Now!
getAdministrationStyles example
$bundleDirectoryName
=
preg_replace
(
'/bundle$/', '',
mb_strtolower
(
$bundle
->
getName
(
)
)
)
;
if
(
$bundleDirectoryName
=== null
)
{
throw
ApiException::
unableGenerateBundle
(
$bundle
->
getName
(
)
)
;
}
$styles
=
array_map
(
static
function
Dstring
$filename
)
use
(
$package
,
$bundleDirectoryName
)
{
$url
= 'bundles/' .
$bundleDirectoryName
. '/' .
$filename
;
return
$package
->
getUrl
(
$url
)
;
}
,
$this
->
getAdministrationStyles
(
$bundle
)
)
;
$scripts
=
array_map
(
static
function
Dstring
$filename
)
use
(
$package
,
$bundleDirectoryName
)
{
$url
= 'bundles/' .
$bundleDirectoryName
. '/' .
$filename
;
return
$package
->
getUrl
(
$url
)
;
}
,
$this
->
getAdministrationScripts
(
$bundle
)
)
;
$baseUrl
=
$this
->
getBaseUrl
(
$bundle
,
$package
,
$bundleDirectoryName
)
;
if
(
empty
(
$styles
)
&&
empty
(
$scripts
)
)
{
if
(
$baseUrl
=== null
)
{