Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
TransDefaultDomainTokenParser example
new
TwigFilter
(
'trans',
$this
->
trans
(
...
)
)
,
]
;
}
public
function
getTokenParsers
(
)
: array
{
return
[
// {% trans %}Symfony is great!{% endtrans %}
new
TransTokenParser
(
)
,
// {% trans_default_domain "foobar" %}
new
TransDefaultDomainTokenParser
(
)
,
]
;
}
public
function
getNodeVisitors
(
)
: array
{
return
[
$this
->
getTranslationNodeVisitor
(
)
,
new
TranslationDefaultDomainNodeVisitor
(
)
]
;
}
public
function
getTranslationNodeVisitor
(
)
: TranslationNodeVisitor
{
return
$this
->translationNodeVisitor ?:
$this
->translationNodeVisitor =
new
TranslationNodeVisitor
(
)
;
}