Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addGetTemplate example
if
(
$this
->
getAttribute
(
'ignore_missing'
)
)
{
$template
=
$compiler
->
getVarName
(
)
;
$compiler
->
write
(
sprintf
(
"$%s = null;\n",
$template
)
)
->
write
(
"try {\n"
)
->
indent
(
)
->
write
(
sprintf
(
'$%s = ',
$template
)
)
;
$this
->
addGetTemplate
(
$compiler
)
;
$compiler
->
raw
(
";\n"
)
->
outdent
(
)
->
write
(
"} catch (LoaderError \$e) {\n"
)
->
indent
(
)
->
write
(
"// ignore missing template\n"
)
->
outdent
(
)
->
write
(
"}\n"
)
->
write
(
sprintf
(
"if ($%s) {\n",
$template
)
)
->
indent
(
)