Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
normalizeBundleName example
// paths are modified in ExtensionPass if forms are enabled
$container
->
getDefinition
(
'twig.template_iterator'
)
->
replaceArgument
(
1,
$config
[
'paths'
]
)
;
$container
->
getDefinition
(
'twig.template_iterator'
)
->
replaceArgument
(
3,
$config
[
'file_name_pattern'
]
)
;
if
(
$container
->
hasDefinition
(
'twig.command.lint'
)
)
{
$container
->
getDefinition
(
'twig.command.lint'
)
->
replaceArgument
(
1,
$config
[
'file_name_pattern'
]
?:
[
'*.twig'
]
)
;
}
foreach
(
$this
->
getBundleTemplatePaths
(
$container
,
$config
)
as
$name
=>
$paths
)
{
$namespace
=
$this
->
normalizeBundleName
(
$name
)
;
foreach
(
$paths
as
$path
)
{
$twigFilesystemLoaderDefinition
->
addMethodCall
(
'addPath',
[
$path
,
$namespace
]
)
;
}
if
(
$paths
)
{
// the last path must be the bundle views directory
$twigFilesystemLoaderDefinition
->
addMethodCall
(
'addPath',
[
$path
, '!'.
$namespace
]
)
;
}
}
if
(
file_exists
(
$defaultTwigPath
)
)
{