Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getTwigOptions example
}
}
)
;
$this
->
callAfter
(
$services
,
$hook
,
$script
)
;
}
private
function
initEnv
(
Script
$script
)
: Environment
{
$twig
=
new
TwigEnvironment
(
new
ScriptTwigLoader
(
$script
)
,
$script
->
getTwigOptions
(
)
)
;
$twig
->
addExtension
(
new
PhpSyntaxExtension
(
)
)
;
$twig
->
addExtension
(
$this
->translationExtension
)
;
$twig
->
addExtension
(
new
SecurityExtension
(
[
]
)
)
;
$twig
->
addExtension
(
new
PcreExtension
(
)
)
;
$twig
->
addExtension
(
new
ReplaceRecursiveFilter
(
)
)
;
if
(
$script
->
getTwigOptions
(
)
[
'debug'
]
?? false
)
{
$twig
->
addExtension
(
new
DebugExtension
(
)
)
;
}
implode
(
', ',
array_keys
(
$context
)
)
,
$this
->script
)
,
$lastModified
,
null,
$options
)
;
$twig
=
new
TwigEnvironment
(
new
ScriptTwigLoader
(
$script
)
,
$script
->
getTwigOptions
(
)
)
;
$twig
->
addExtension
(
new
PhpSyntaxExtension
(
)
)
;
$twig
->
addExtension
(
new
ComparisonExtension
(
)
)
;
$twig
->
addExtension
(
new
PcreExtension
(
)
)
;
$twig
->
addExtension
(
new
ReplaceRecursiveFilter
(
)
)
;
if
(
$this
->debug
)
{
$twig
->
addExtension
(
new
DebugExtension
(
)
)
;
}