Skip to content

Commit 31cb844

Browse files
committed
Reformat example
1 parent f4eb873 commit 31cb844

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ $twigLoader = new FilesystemLoader('./tpl/');
5252
$twig = new Environment($twigLoader, $twigConfig);
5353

5454
// this is for the filter |trans
55-
$filter = new TwigFilter('trans', function ($context, $string) {
56-
return Translation::TransGetText($string, $context);
57-
}, ['needs_context' => true]);
55+
$filter = new TwigFilter(
56+
'trans',
57+
function ($context, $string) {
58+
return Translation::transGetText($string, $context);
59+
},
60+
['needs_context' => true]
61+
);
5862
$twig->addFilter($filter);
5963

6064
// load the i18n extension for using the translation tag for twig

example/example.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@
3232
$twig = new Environment($twigLoader, $twigConfig);
3333

3434
// this is for the filter |trans
35-
$filter = new TwigFilter('trans', function ($context, $string) {
36-
return Translation::transGetText($string, $context);
37-
}, ['needs_context' => true]);
35+
$filter = new TwigFilter(
36+
'trans',
37+
function ($context, $string) {
38+
return Translation::transGetText($string, $context);
39+
},
40+
['needs_context' => true]
41+
);
3842
$twig->addFilter($filter);
3943

4044
// load the i18n extension for using the translation tag for twig

0 commit comments

Comments
 (0)