Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
disableStrictVariables example
try
{
return
$this
->twig->
render
(
$name
,
$data
)
;
}
catch
(
Error
$error
)
{
throw
new
StringTemplateRenderingException
(
$error
->
getMessage
(
)
)
;
}
}
public
function
enableTestMode
(
)
: void
{
$this
->twig->
addGlobal
(
'testMode', true
)
;
$this
->twig->
disableStrictVariables
(
)
;
}
public
function
disableTestMode
(
)
: void
{
$this
->twig->
addGlobal
(
'testMode', false
)
;
$this
->twig->
enableStrictVariables
(
)
;
}
}