Skip to content

Commit e41f32f

Browse files
rgagnon24javiereguiluz
authored andcommitted
Correct method name in example
The "new in 1.26" example references a method in the initial example that was named "formatPrice" yet the documentation referred to it as "priceFilter".
1 parent 43ab973 commit e41f32f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templating/twig_extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Create a class that extends ``AbstractExtension`` and fill in the logic::
3434
public function getFilters()
3535
{
3636
return [
37-
new TwigFilter('price', [$this, 'formatPrice']),
37+
new TwigFilter('price', [$this, 'priceFilter']),
3838
];
3939
}
4040

41-
public function formatPrice($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',')
41+
public function priceFilter($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',')
4242
{
4343
$price = number_format($number, $decimals, $decPoint, $thousandsSep);
4444
$price = '$'.$price;

0 commit comments

Comments
 (0)