Skip to content

Commit ccbd178

Browse files
committed
minor #11512 Correct method name in example (rgagnon24)
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes #11512). Discussion ---------- 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". <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- e41f32f Correct method name in example
2 parents 43ab973 + e41f32f commit ccbd178

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)