Skip to content

Commit

Permalink
remove not needed env parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlond committed Jul 21, 2020
1 parent 57123e2 commit 0e7c598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ $twigLoader = new FilesystemLoader('./tpl/');
$twig = new Environment($twigLoader, $twigConfig);

// this is for the filter |trans
$filter = new TwigFilter('trans', function (Environment $env, $context, $string) {
$filter = new TwigFilter('trans', function ($context, $string) {
return Translation::TransGetText($string, $context);
}, ['needs_context' => true, 'needs_environment' => true]);
}, ['needs_context' => true]);

// load the i18n extension for using the translation tag for twig
// {% trans %}my string{% endtrans %}
Expand Down
4 changes: 2 additions & 2 deletions example/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
$twig = new Environment($twigLoader, $twigConfig);

// this is for the filter |trans
$filter = new TwigFilter('trans', function (Environment $env, $context, $string) {
$filter = new TwigFilter('trans', function ($context, $string) {
return Translation::transGetText($string, $context);
}, ['needs_context' => true, 'needs_environment' => true]);
}, ['needs_context' => true]);

// load the i18n extension for using the translation tag for twig
// {% trans %}my string{% endtrans %}
Expand Down

0 comments on commit 0e7c598

Please sign in to comment.