We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cefee11 commit aaabeb8Copy full SHA for aaabeb8
components/string.rst
@@ -468,6 +468,15 @@ that only includes safe ASCII characters::
468
$slug = $slugger->slug('Wôrķšƥáçè ~~sèťtïñğš~~');
469
// $slug = 'Workspace-settings'
470
471
+ // you can also pass an array with additional character substitutions
472
+ $slugger = new AsciiSlugger('en', ['%' => 'percent', '€' => 'euro']);
473
+ $slug = $slugger->slug('10% or 5€');
474
+ // $slug = '10-percent-or-5-euro'
475
+
476
+.. versionadded:: 5.1
477
478
+ The feature to define additional substitutions was introduced in Symfony 5.1.
479
480
The separator between words is a dash (``-``) by default, but you can define
481
another separator as the second argument::
482
0 commit comments