{"id":13563078,"url":"https://github.com/cocur/slugify","last_synced_at":"2025-05-13T15:10:58.490Z","repository":{"id":2810320,"uuid":"3811518","full_name":"cocur/slugify","owner":"cocur","description":"Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.","archived":false,"fork":false,"pushed_at":"2024-09-10T14:11:09.000Z","size":774,"stargazers_count":2896,"open_issues_count":30,"forks_count":251,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-05-03T08:08:24.720Z","etag":null,"topics":["language","latte","nette","php","silex","slugify","symfony","twig","twig-extension","zend-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cocur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-03-23T18:57:44.000Z","updated_at":"2025-05-02T06:07:11.000Z","dependencies_parsed_at":"2023-07-05T20:03:13.273Z","dependency_job_id":"dda4fbb8-d831-4dd3-8d1d-2493da24fe0b","html_url":"https://github.com/cocur/slugify","commit_stats":{"total_commits":411,"total_committers":107,"mean_commits":"3.8411214953271027","dds":0.7956204379562044,"last_synced_commit":"1d674022e9cbefa80b4f51aa3e2375b6e3c14fdb"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocur%2Fslugify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocur%2Fslugify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocur%2Fslugify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocur%2Fslugify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cocur","download_url":"https://codeload.github.com/cocur/slugify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969248,"owners_count":21992263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language","latte","nette","php","silex","slugify","symfony","twig","twig-extension","zend-framework"],"created_at":"2024-08-01T13:01:14.938Z","updated_at":"2025-05-13T15:10:53.472Z","avatar_url":"https://github.com/cocur.png","language":"PHP","funding_links":["https://paypal.me/florianec/2"],"categories":["Data Processing","字符串","PHP","目录","Table of Contents","Text and Numbers","Strings","字符串( Strings )","Natural Language Processing","字符串 Strings"],"sub_categories":["Tokenizers \u0026 Prompt Utilities","字符串 Strings","Strings","Utilities \u0026 Tools","Library"],"readme":"# cocur/slugify\n\n\u003e Converts a string into a slug.\n\n[![Build Status](https://img.shields.io/travis/cocur/slugify.svg?style=flat)](https://travis-ci.org/cocur/slugify)\n[![Windows Build status](https://ci.appveyor.com/api/projects/status/9yv498ff61byp742?svg=true)](https://ci.appveyor.com/project/florianeckerstorfer/slugify)\n[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/cocur/slugify.svg?style=flat)](https://scrutinizer-ci.com/g/cocur/slugify/)\n[![Code Coverage](https://scrutinizer-ci.com/g/cocur/slugify/badges/coverage.png?b=master\u0026style=flat-square)](https://scrutinizer-ci.com/g/cocur/slugify/?branch=master)\n\n[![Latest Release](https://img.shields.io/packagist/v/cocur/slugify.svg)](https://packagist.org/packages/cocur/slugify)\n[![MIT License](https://img.shields.io/packagist/l/cocur/slugify.svg)](http://opensource.org/licenses/MIT)\n[![Total Downloads](https://img.shields.io/packagist/dt/cocur/slugify.svg)](https://packagist.org/packages/cocur/slugify)\n\nDeveloped by [Florian Eckerstorfer](https://florian.ec) in Vienna, Europe with the help of\n[many great contributors](https://github.com/cocur/slugify/graphs/contributors).\n\n## Features\n\n-   Removes all special characters from a string.\n-   Provides custom replacements for Arabic, Austrian, Azerbaijani, Brazilian Portuguese, Bulgarian, Burmese, Chinese, Croatian, Czech, Esperanto, Estonian, Finnish, French, Georgian, German, Greek, Hindi, Hungarian, Italian, Latvian, Lithuanian, Macedonian, Norwegian, Polish, Romanian, Russian, Serbian, Spanish, Swedish, Turkish, Ukrainian, Vietnamese and Yiddish special characters. Instead of removing these characters, Slugify approximates them (e.g., `ae` replaces `ä`).\n-   No external dependencies.\n-   PSR-4 compatible.\n-   Compatible with PHP \u003e= 8.\n-   Integrations for [Symfony (3, 4 and 5)](http://symfony.com), [Laravel](http://laravel.com), [Twig (2 and 3)](http://twig.sensiolabs.org), [Zend Framework 2](http://framework.zend.com/), [Nette Framework](http://nette.org/), [Latte](http://latte.nette.org/) and [Plum](https://github.com/plumphp/plum).\n\n## Installation\n\nYou can install Slugify through [Composer](https://getcomposer.org):\n\n```shell\ncomposer require cocur/slugify\n```\n\nSlugify requires the Multibyte String extension from PHP. Typically you can use the configure option `--enable-mbstring` while compiling PHP. More information can be found in the [PHP documentation](http://php.net/manual/en/mbstring.installation.php).\n\nFurther steps may be needed for [integrations](#integrations).\n\n## Usage\n\nGenerate a slug:\n\n```php\nuse Cocur\\Slugify\\Slugify;\n\n$slugify = new Slugify();\necho $slugify-\u003eslugify(\"Hello World!\"); // hello-world\n```\n\nYou can also change the separator used by `Slugify`:\n\n```php\necho $slugify-\u003eslugify(\"Hello World!\", \"_\"); // hello_world\n```\n\nThe library also contains `Cocur\\Slugify\\SlugifyInterface`. Use this interface whenever you need to type hint an\ninstance of `Slugify`.\n\nTo add additional transliteration rules you can use the `addRule()` method.\n\n```php\n$slugify-\u003eaddRule(\"i\", \"ey\");\necho $slugify-\u003eslugify(\"Hi\"); // hey\n```\n\n### Rulesets\n\nMany of the transliterations rules used in Slugify are specific to a language. These rules are therefore categorized\nusing rulesets. Rules for the most popular are activated by default in a specific order. You can change which rulesets\nare activated and the order in which they are activated. The order is important when there are conflicting rules in\ndifferent languages. For example, in German `ä` is transliterated with `ae`, in Turkish the correct transliteration is\n`a`. By default the German transliteration is used since German is used more often on the internet. If you want to use\nprefer the Turkish transliteration you have to possibilities. You can activate it after creating the constructor:\n\n```php\n$slugify = new Slugify();\n$slugify-\u003eslugify(\"ä\"); // -\u003e \"ae\"\n$slugify-\u003eactivateRuleSet(\"turkish\");\n$slugify-\u003eslugify(\"ä\"); // -\u003e \"a\"\n```\n\nAn alternative way would be to pass the rulesets and their order to the constructor.\n\n```php\n$slugify = new Slugify([\"rulesets\" =\u003e [\"default\", \"turkish\"]]);\n$slugify-\u003eslugify(\"ä\"); // -\u003e \"a\"\n```\n\nYou can find a list of the available rulesets in [Resources/rules](https://github.com/cocur/slugify/tree/master/Resources/rules).\n\n### More options\n\nThe constructor takes an options array, you have already seen the `rulesets` options above. You can also change the\nregular expression that is used to replace characters with the separator.\n\n```php\n$slugify = new Slugify([\"regexp\" =\u003e \"/([^A-Za-z0-9]|-)+/\"]);\n```\n\n_(The regular expression used in the example above is the default one.)_\n\nBy default Slugify will convert the slug to lowercase. If you want to preserve the case of the string you can set the\n`lowercase` option to false.\n\n```php\n$slugify = new Slugify([\"lowercase\" =\u003e false]);\n$slugify-\u003eslugify(\"Hello World\"); // -\u003e \"Hello-World\"\n```\n\nLowercasing is done before using the regular expression. If you want to keep the lowercasing behavior but your regular\nexpression needs to match uppercase letters, you can set the `lowercase_after_regexp` option to `true`.\n\n```php\n$slugify = new Slugify([\n    \"regexp\" =\u003e \"/(?\u003c=[[:^upper:]])(?=[[:upper:]])/\",\n    \"lowercase_after_regexp\" =\u003e false,\n]);\n$slugify-\u003eslugify(\"FooBar\"); // -\u003e \"foo-bar\"\n```\n\nBy default Slugify will use dashes as separators. If you want to use a different default separator, you can set the\n`separator` option.\n\n```php\n$slugify = new Slugify([\"separator\" =\u003e \"_\"]);\n$slugify-\u003eslugify(\"Hello World\"); // -\u003e \"hello_world\"\n```\n\nBy default Slugify will remove leading and trailing separators before returning the slug. If you do not want the slug to\nbe trimmed you can set the `trim` option to false.\n\n```php\n$slugify = new Slugify([\"trim\" =\u003e false]);\n$slugify-\u003eslugify(\"Hello World \"); // -\u003e \"hello-world-\"\n```\n\n### Changing options on the fly\n\nYou can overwrite any of the above options on the fly by passing an options array as second argument to the `slugify()`\nmethod. For example:\n\n```php\n$slugify = new Slugify();\n$slugify-\u003eslugify(\"Hello World\", [\"lowercase\" =\u003e false]); // -\u003e \"Hello-World\"\n```\n\nYou can also modify the separator this way:\n\n```php\n$slugify = new Slugify();\n$slugify-\u003eslugify(\"Hello World\", [\"separator\" =\u003e \"_\"]); // -\u003e \"hello_world\"\n```\n\nYou can even activate a custom ruleset without touching the default rules:\n\n```php\n$slugify = new Slugify();\n$slugify-\u003eslugify(\"für\", [\"ruleset\" =\u003e \"turkish\"]); // -\u003e \"fur\"\n$slugify-\u003eslugify(\"für\"); // -\u003e \"fuer\"\n```\n\n### Contributing\n\nWe really appreciate if you report bugs and errors in the transliteration, especially if you are a native speaker of\nthe language and question. Feel free to ask for additional languages in the issues, but please note that the\nmaintainer of this repository does not speak all languages. If you can provide a Pull Request with rules for\na new language or extend the rules for an existing language that would be amazing.\n\nTo add a new language you need to:\n\n1. Create a `[language].json` in `Resources/rules`\n2. If you believe the language should be a default ruleset you can add the language to\n   `Cocur\\Slugify\\Slugify::$options`. If you add the language there all existing tests still have to pass\n3. Run `php bin/generate-default.php`\n4. Add tests for the language in `tests/SlugifyTest.php`. If the language is in the default ruleset add your\n   test cases to `defaultRuleProvider()`, otherwise to `customRulesProvider()`.\n\nSubmit PR. Thank you very much. 💚\n\n### Code of Conduct\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\nThe full Code of Conduct can be found [here](https://github.com/cocur/slugify/blob/master/CODE_OF_CONDUCT.md).\n\nThis project is no place for hate. If you have any problems please contact Florian: [florian@eckerstorfer.net](mailto:florian@eckerstorfer.net) ✌🏻🏳️‍🌈\n\n### Further information\n\n-   [API docs](http://cocur.co/slugify/api/master/)\n\n## Integrations\n\n### Symfony\n\nSlugify contains a Symfony bundle and service definition that allow you to use it as a service in your Symfony application. The code resides in `Cocur\\Slugify\\Bridge\\Symfony\\CocurSlugifyBundle` and you only need to activate it:\n\n#### Symfony 2\n\nSupport for Symfony 2 has been dropped in Slugify 4.0.0, use `cocur/slugify@3`.\n\n#### Symfony 3\n\n```php\n// app/AppKernel.php\n\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = [\n            // ...\n            new Cocur\\Slugify\\Bridge\\Symfony\\CocurSlugifyBundle(),\n        ];\n    }\n}\n```\n\n#### Symfony \u003e= 4\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    Cocur\\Slugify\\Bridge\\Symfony\\CocurSlugifyBundle::class =\u003e [\"all\" =\u003e true],\n];\n```\n\nYou can now use the `cocur_slugify` service everywhere in your application, for example, in your controller:\n\n```php\n$slug = $this-\u003eget(\"cocur_slugify\")-\u003eslugify(\"Hello World!\");\n```\n\nThe bundle also provides an alias `slugify` for the `cocur_slugify` service:\n\n```php\n$slug = $this-\u003eget(\"slugify\")-\u003eslugify(\"Hello World!\");\n```\n\nIf you use `autowire` (Symfony \u003e=3.3), you can inject it into your services like this:\n\n```php\npublic function __construct(\\Cocur\\Slugify\\SlugifyInterface $slugify)\n```\n\n#### Symfony Configuration\n\nYou can set the following configuration settings in `config.yml` (Symfony 2-3) or\n`config/packages/cocur_slugify.yaml` (Symfony 4) to adjust the slugify service:\n\n```yaml\ncocur_slugify:\n    lowercase: false # or true\n    separator: \"-\" # any string\n    # regexp: \u003cstring\u003e\n    rulesets: [\"austrian\"] # List of rulesets: https://github.com/cocur/slugify/tree/master/Resources/rules\n```\n\n### Twig\n\nIf you use the Symfony framework with Twig you can use the Twig filter `slugify` in your templates after you have setup\nSymfony integrations (see above).\n\n```twig\n{{ 'Hällo Wörld'|slugify }}\n```\n\nIf you use Twig outside of the Symfony framework you first need to add the extension to your environment:\n\n```php\nuse Cocur\\Slugify\\Bridge\\Twig\\SlugifyExtension;\nuse Cocur\\Slugify\\Slugify;\n\n$twig = new Twig_Environment($loader);\n$twig-\u003eaddExtension(new SlugifyExtension(Slugify::create()));\n```\n\nTo use the Twig filter with [TwigBridge](https://github.com/rcrowe/TwigBridge) for Laravel, you'll need to add the\nSlugify extension using a closure:\n\n```php\n// laravel/app/config/packages/rcrowe/twigbridge/config.php\n\n'extensions' =\u003e array(\n    //...\n    function () {\n        return new \\Cocur\\Slugify\\Bridge\\Twig\\SlugifyExtension(\\Cocur\\Slugify\\Slugify::create());\n    },\n),\n```\n\nYou can find more information about registering extensions in the\n[Twig documentation](http://twig.sensiolabs.org/doc/advanced.html#creating-an-extension).\n\n### Mustache.php\n\nWe don't need an additional integration to use Slugify in [Mustache.php](https://github.com/bobthecow/mustache.php).\nIf you want to use Slugify in Mustache, just add a helper:\n\n```php\nuse Cocur\\Slugify\\Slugify;\n\n$mustache = new Mustache_Engine([\n    // ...\n    \"helpers\" =\u003e [\n        \"slugify\" =\u003e function ($string, $separator = null) {\n            return Slugify::create()-\u003eslugify($string, $separator);\n        },\n    ],\n]);\n```\n\n### Laravel\n\nSlugify also provides a service provider to integrate into Laravel (versions 4.1 and later).\n\nIn your Laravel project's `app/config/app.php` file, add the service provider into the \"providers\" array:\n\n```php\n'providers' =\u003e array(\n    \"Cocur\\Slugify\\Bridge\\Laravel\\SlugifyServiceProvider\",\n)\n```\n\nAnd add the facade into the \"aliases\" array:\n\n```php\n'aliases' =\u003e array(\n    \"Slugify\" =\u003e \"Cocur\\Slugify\\Bridge\\Laravel\\SlugifyFacade\",\n)\n```\n\nYou can then use the `Slugify::slugify()` method in your controllers:\n\n```php\n$url = Slugify::slugify(\"welcome to the homepage\");\n```\n\n### Zend Framework 2\n\nSlugify can be easely used in Zend Framework 2 applications. Included bridge provides a service and a view helper\nalready registered for you.\n\nJust enable the module in your configuration like this.\n\n```php\nreturn [\n    //...\n\n    \"modules\" =\u003e [\n        \"Application\",\n        \"ZfcBase\",\n        \"Cocur\\Slugify\\Bridge\\ZF2\", // \u003c- Add this line\n        //...\n    ],\n\n    //...\n];\n```\n\nAfter that you can retrieve the `Cocur\\Slugify\\Slugify` service (or the `slugify` alias) and generate a slug.\n\n```php\n/** @var \\Zend\\ServiceManager\\ServiceManager $sm */\n$slugify = $sm-\u003eget(\"Cocur\\Slugify\\Slugify\");\n$slug = $slugify-\u003eslugify(\"Hällo Wörld\");\n$anotherSlug = $slugify-\u003eslugify(\"Hällo Wörld\", \"_\");\n```\n\nIn your view templates use the `slugify` helper to generate slugs.\n\n```php\n\u003c?php echo $this-\u003eslugify(\"Hällo Wörld\"); ?\u003e\n\u003c?php echo $this-\u003eslugify(\"Hällo Wörld\", \"_\"); ?\u003e\n```\n\nThe service (which is also used in the view helper) can be customized by defining this configuration key.\n\n```php\nreturn [\n    \"cocur_slugify\" =\u003e [\n        \"reg_exp\" =\u003e \"/([^a-zA-Z0-9]|-)+/\",\n    ],\n];\n```\n\n### Nette Framework\n\nSlugify contains a Nette extension that allows you to use it as a service in your Nette application. You only need to\nregister it in your `config.neon`:\n\n```yml\n# app/config/config.neon\n\nextensions:\n    slugify: Cocur\\Slugify\\Bridge\\Nette\\SlugifyExtension\n```\n\nYou can now use the `Cocur\\Slugify\\SlugifyInterface` service everywhere in your application, for example in your\npresenter:\n\n```php\nclass MyPresenter extends \\Nette\\Application\\UI\\Presenter\n{\n    /** @var \\Cocur\\Slugify\\SlugifyInterface @inject */\n    public $slugify;\n\n    public function renderDefault()\n    {\n        $this-\u003etemplate-\u003ehello = $this-\u003eslugify-\u003eslugify(\"Hällo Wörld\");\n    }\n}\n```\n\n### Latte\n\nIf you use the Nette Framework with it's native Latte templating engine, you can use the Latte filter `slugify` in your\ntemplates after you have setup Nette extension (see above).\n\n```smarty\n{$hello|slugify}\n```\n\nIf you use Latte outside of the Nette Framework you first need to add the filter to your engine:\n\n```php\nuse Cocur\\Slugify\\Bridge\\Latte\\SlugifyHelper;\nuse Cocur\\Slugify\\Slugify;\nuse Latte;\n\n$latte = new Latte\\Engine();\n$latte-\u003eaddFilter(\"slugify\", [new SlugifyHelper(Slugify::create()), \"slugify\"]);\n```\n\n### Slim 3\n\nSlugify does not need a specific bridge to work with [Slim 3](http://www.slimframework.com), just add the following configuration:\n\n```php\n$container[\"view\"] = function ($c) {\n    $settings = $c-\u003eget(\"settings\");\n    $view = new \\Slim\\Views\\Twig(\n        $settings[\"view\"][\"template_path\"],\n        $settings[\"view\"][\"twig\"]\n    );\n    $view-\u003eaddExtension(\n        new Slim\\Views\\TwigExtension(\n            $c-\u003eget(\"router\"),\n            $c-\u003eget(\"request\")-\u003egetUri()\n        )\n    );\n    $view-\u003eaddExtension(\n        new Cocur\\Slugify\\Bridge\\Twig\\SlugifyExtension(\n            Cocur\\Slugify\\Slugify::create()\n        )\n    );\n    return $view;\n};\n```\n\nIn a template you can use it like this:\n\n```twig\n\u003ca href=\"/blog/{{ post.title|slugify }}\"\u003e{{ post.title|raw }}\u003c/a\u003e\u003c/h5\u003e\n```\n\n### League\n\nSlugify provides a service provider for use with `league/container`:\n\n```php\nuse Cocur\\Slugify;\nuse League\\Container;\n\n/* @var Container\\ContainerInterface $container */\n$container-\u003eaddServiceProvider(\n    new Slugify\\Bridge\\League\\SlugifyServiceProvider()\n);\n\n/* @var Slugify\\Slugify $slugify */\n$slugify = $container-\u003eget(Slugify\\SlugifyInterface::class);\n```\n\nYou can configure it by sharing the required options:\n\n```php\nuse Cocur\\Slugify;\nuse League\\Container;\n\n/* @var Container\\ContainerInterface $container */\n$container-\u003eshare(\"config.slugify.options\", [\n    \"lowercase\" =\u003e false,\n    \"rulesets\" =\u003e [\"default\", \"german\"],\n]);\n\n$container-\u003eaddServiceProvider(\n    new Slugify\\Bridge\\League\\SlugifyServiceProvider()\n);\n\n/* @var Slugify\\Slugify $slugify */\n$slugify = $container-\u003eget(Slugify\\SlugifyInterface::class);\n```\n\nYou can configure which rule provider to use by sharing it:\n\n```php\nuse Cocur\\Slugify;\nuse League\\Container;\n\n/* @var Container\\ContainerInterface $container */\n$container-\u003eshare(Slugify\\RuleProvider\\RuleProviderInterface::class, function () {\n    return new Slugify\\RuleProvider\\FileRuleProvider(__DIR__ . '/../../rules');\n]);\n\n$container-\u003eaddServiceProvider(new Slugify\\Bridge\\League\\SlugifyServiceProvider());\n\n/* @var Slugify\\Slugify $slugify */\n$slugify = $container-\u003eget(Slugify\\SlugifyInterface::class);\n```\n\n## Change Log\n\n### Version 4.6.0 (10 September 2024)\n\n-   [#336](https://github.com/cocur/slugify/pull/336) Add Yiddish language ruleset ([yankl](https://github.com/yankl))\n-   [#340](https://github.com/cocur/slugify/pull/340) Fix for Symfony 7.1 (by [Evgeny1973](https://github.com/Evgeny1973))\n-   [#342](https://github.com/cocur/slugify/pull/342) Fix PHP 8.4 deprecation about implicit null arguments (by [shyim](https://github.com/shyim))\n\n### Version 4.5.1 (16 September 2023)\n\n-   Drop support for PHP 7 and fix version constraints\n-   Replaces v4.5.0\n\n### Version 4.5 (16 September 2023)\n\n-   [#327](https://github.com/cocur/slugify/pull/327) Add Korean to default ruleset\n-   Replaced by v4.5.1 since this release breaks compatibility with PHP 7\n\n### Version 4.4.1 (17 September 2023)\n\n-   Remove PHP 7 from compatibility list\n-   Replaces v4.4.0\n\n### Version 4.4 (5 August 2023)\n\n-   [#320](https://github.com/cocur/slugify/pull/320) Add Korean (by [MrMooky](https://github.com/MrMooky))\n-   [#322](https://github.com/cocur/slugify/pull/322) Add types to avoid PHP 8.2 deprecation warning (by [antoniovj1](https://github.com/antoniovj1))\n-   Replaced by v4.4.1 since this release broke compatibility with PHP 7\n\n### Version 4.3 (7 December 2022)\n\n-   [#317](https://github.com/cocur/slugify/pull/317) Add PHP 8.2 support (by [fezfez](https://github.com/fezfez))\n\n### Version 4.2 (13 August 2022)\n\n-   [#305](https://github.com/cocur/slugify/pull/305) Add support for custom fonts (by [luca-alsina](https://github.com/luca-alsina))\n-   [#309](https://github.com/cocur/slugify/pull/309) Add handling for undefined rulesets (by [aadmathijssen](https://github.com/aadmathijssen))\n-   [#227](https://github.com/cocur/slugify/pull/227) Add support for capital sharp s (by [weeman1337](https://github.com/weeman1337))\n-   [#312](https://github.com/cocur/slugify/pull/312) Fix composer.lock file (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#313](https://github.com/cocur/slugify/pull/313) Update PHP version requirement (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n\n### Version 4.1 (11 January 2022)\n\nSupport for Symfony 6.\n\n-   [#244](https://github.com/cocur/slugify/pull/244) .gitignore cleanup (by [kubawerlos](https://github.com/kubawerlos))\n-   [#259](https://github.com/cocur/slugify/pull/259) Fix portuguese-brazil language (by [stephandesouza](https://github.com/stephandesouza))\n-   [#272](https://github.com/cocur/slugify/pull/272) Improve tests about assertions (by [peter279k](https://github.com/peter279k))\n-   [#278](https://github.com/cocur/slugify/pull/278) Update georgian.json (by [nikameto](https://github.com/nikameto))\n-   [#299](https://github.com/cocur/slugify/pull/299) Allow Symfony 6 and resolve depreciations (by [GromNaN](https://github.com/GromNaN))\n-   [#264](https://github.com/cocur/slugify/pull/264) Add new Gujarati language (by [infynnoTech](https://github.com/infynnoTech))\n-   [#297](https://github.com/cocur/slugify/pull/297) More Yoruba character support (by [9jaGuy](https://github.com/9jaGuy))\n\n### Version 4.0 (14 December 2019)\n\nVersion 4 does not introduce new major features, but adds support for Symfony 4 and 5, Twig 3 and, most importantly, PHP 7.3 and 7.4.\n\nSupport for PHP 5, Twig 1 and Silex is dropped.\n\n-   [#230](https://github.com/cocur/slugify/pull/230) Add Slovak rules (by [bartko-s](https://github.com/bartko-s))\n-   [#236](https://github.com/cocur/slugify/pull/236) Make Twig Bridge compatible with Twig 3.0 (by [mhujer](https://github.com/mhujer))\n-   [#237](https://github.com/cocur/slugify/pull/237) Fix Travis CI configuration (by [kubawerlos](https://github.com/kubawerlos))\n-   [#238](https://github.com/cocur/slugify/pull/238) Drop Twig 1 support (by [FabienPapet](https://github.com/FabienPapet))\n-   [#239](https://github.com/cocur/slugify/pull/239) Fix AppVeyor (by [kubawerlos](https://github.com/kubawerlos))\n-   [#241](https://github.com/cocur/slugify/pull/241) Update .gitattributes (by [kubawerlos](https://github.com/kubawerlos))\n-   [#242](https://github.com/cocur/slugify/pull/242) Add PHP CS Fixer (by [kubawerlos](https://github.com/kubawerlos))\n-   [#243](https://github.com/cocur/slugify/pull/243) Normalize composer.json (by [kubawerlos](https://github.com/kubawerlos))\n-   [#246](https://github.com/cocur/slugify/pull/246) Add support for PHP 7.3 and 7.4 (by [snapshotpl](https://github.com/snapshotpl))\n-   [#247](https://github.com/cocur/slugify/pull/247) AppVeyor improvements (by [kubawerlos](https://github.com/kubawerlos))\n-   [#249](https://github.com/cocur/slugify/pull/249) PHPUnit annotations should be a FQCNs including a root namespace (by [kubawerlos](https://github.com/kubawerlos))\n-   [#250](https://github.com/cocur/slugify/pull/250) Add support for Symfony 4 and 5 (by [franmomu](https://github.com/franmomu))\n-   [#251](https://github.com/cocur/slugify/pull/251) Dropping support for PHP 5 (by [franmomu](https://github.com/franmomu))\n-   [#253](https://github.com/cocur/slugify/pull/253) Add conflict for unmaintained Symfony versions (by [franmomu](https://github.com/franmomu))\n\n### Version 3.2 (31 January 2019)\n\n-   [#201](https://github.com/cocur/slugify/pull/201) Add strip_tags option (by [thewilkybarkid](https://github.com/thewilkybarkid))\n-   [#212](https://github.com/cocur/slugify/pull/212) Fix Macedonian Dze (by [franmomu](https://github.com/franmomu))\n-   [#213](https://github.com/cocur/slugify/pull/213) Add support for Turkmen (by [umbarov](https://github.com/umbarov))\n-   [#216](https://github.com/cocur/slugify/pull/216) Add lowercase_after_regexp option (by [julienfalque](https://github.com/julienfalque))\n-   [#217](https://github.com/cocur/slugify/pull/217) Simplify default regular impression (by [julienfalque](https://github.com/julienfalque))\n-   [#220](https://github.com/cocur/slugify/pull/220) Fix deprecation warning for symfony/config 4.2+ (by [franmomu](https://github.com/franmomu))\n-   [#221](https://github.com/cocur/slugify/pull/221) Add suuport Armenian (by [boolfalse](https://github.com/boolfalse))\n\n### Version 3.1 (22 January 2018)\n\n-   [#195](https://github.com/cocur/slugify/pull/195) Add support for Chinese (Pinyin) (by [SuN-80](https://github.com/SuN-80), [franmomu](https://github.com/franmomu))\n-   [#189](https://github.com/cocur/slugify/pull/189) Add trim option (by [sforsberg](https://github.com/sforsberg))\n\n### Version 3.0.1 (24 September 2017)\n\n-   [#183](https://github.com/cocur/slugify/pull/183) Fix invalid JSON ([RusiPapazov](https://github.com/RusiPapazov))\n-   [#185](https://github.com/cocur/slugify/pull/185) Fix support for Symfony \u003e 3.3 (by [FabienPapet](https://github.com/FabienPapet))\n-   [#186](https://github.com/cocur/slugify/pull/186) Require Multibyte extension in `composer.json` (by [wandersonwhcr](https://github.com/wandersonwhcr))\n\n### Version 3.0 (11 August 2017)\n\n-   HHVM is no longer supported\n-   Bugfix [#165](https://github.com/cocur/slugify/issues/165) Added missing French rules to `DefaultRuleProvider` (by [gsouf](https://github.com/gsouf))\n-   [#168](https://github.com/cocur/slugify/pull/168) Add Persian rules (by [mohammad6006](https://github.com/mohammad6006))\n-   Bugfix [#169](https://github.com/cocur/slugify/issues/169) Add missing `getName()` to `Cocur\\Slugify\\Bridge\\Twig\\SlugifyExtension` (by [TomCan](https://github.com/TomCan))\n-   [#172](https://github.com/cocur/slugify/pull/172) Sort rules in `DefaultRuleProvider` alphabetically (by [tbmatuka](https://github.com/tbmatuka))\n-   [#174](https://github.com/cocur/slugify/pull/174) Add Hungarian rules (by [rviktor87](https://github.com/rviktor87))\n-   [#180](https://github.com/cocur/slugify/pull/180) Add Brazilian Portuguese rules (by [tallesairan](https://github.com/tallesairan))\n-   Bugfix [#181](https://github.com/cocur/slugify/pull/181) Add missing French rules (by [FabienPapet](https://github.com/FabienPapet))\n\n### Version 2.5 (23 March 2017)\n\n-   [#150](https://github.com/cocur/slugify/pull/150) Add Romanian rules (by [gabiudrescu](https://github.com/gabiudrescu))\n-   [#154](https://github.com/cocur/slugify/pull/154) Add French rules (by [SuN-80](https://github.com/SuN-80))\n-   [#159](https://github.com/cocur/slugify/pull/159) Add Estonian rules (by [erkimiilberg](https://github.com/erkimiilberg))\n-   [#162](https://github.com/cocur/slugify/pull/162) Add support for Twig 2 (by [JakeFr](https://github.com/JakeFr))\n\n### Version 2.4 (9 February 2017)\n\n-   [#133](https://github.com/cocur/slugify/pull/133) Allow to modify options without creating a new object (by [leofeyer](https://github.com/leofeyer))\n-   [#135](https://github.com/cocur/slugify/pull/135) Add support for Danish (by [izehose](https://github.com/izehose))\n-   [#140](https://github.com/cocur/slugify/pull/140) Update Hindi support (by [arunlodhi](https://github.com/arunlodhi))\n-   [#146](https://github.com/cocur/slugify/pull/146) Add support for Italien (by [gianiaz](https://github.com/gianiaz))\n-   [#151](https://github.com/cocur/slugify/pull/151) Add support for Serbian (by [cvetan](https://github.com/cvetan))\n-   [#155](https://github.com/cocur/slugify/pull/155) Update support for Lithuanian (by [s4uliu5](https://github.com/s4uliu5))\n\n### Version 2.3 (9 August 2016)\n\n-   [#124](https://github.com/cocur/slugify/issues/124) Fix support for Bulgarian\n-   [#125](https://github.com/cocur/slugify/pull/125) Update Silex 2 provider (by [JakeFr](https://github.com/JakeFr))\n-   [#129](https://github.com/cocur/slugify/pull/129) Add support for Croatian (by [napravicukod](https://github.com/napravicukod))\n\n### Version 2.2 (10 July 2016)\n\n-   [#102](https://github.com/cocur/slugify/pull/102) Add transliterations for Azerbaijani (by [seferov](https://github.com/seferov))\n-   [#109](https://github.com/cocur/slugify/pull/109) Made integer values into strings (by [JonathanMH](https://github.com/JonathanMH))\n-   [#114](https://github.com/cocur/slugify/pull/114) Provide SlugifyServiceProvider for league/container (by [localheinz](https://github.com/localheinz))\n-   [#120](https://github.com/cocur/slugify/issues/120) Add compatibility with Silex 2 (by [shamotj](https://github.com/shamotj))\n\n### Version 2.1.1 (8 April 2016)\n\n-   Do not activate Swedish rules by default (fixes broken v2.1 release)\n\n### Version 2.1.0 (8 April 2016)\n\n-   [#104](https://github.com/cocur/slugify/pull/104) Add Symfony configuration (by [estahn](https://github.com/estahn))\n-   [#107](https://github.com/cocur/slugify/issues/107) Fix Swedish rules\n\n### Version 2.0.0 (24 February 2016)\n\n-   [#78](https://github.com/cocur/slugify/pull/78) Use multibyte-safe case convention (by [Koc](https://github.com/Koc))\n-   [#81](https://github.com/cocur/slugify/pull/81) Move rules into JSON files (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#84](https://github.com/cocur/slugify/pull/84) Add tests for very long strings containing umlauts (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#88](https://github.com/cocur/slugify/pull/88) Add rules for Hindi (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#89](https://github.com/cocur/slugify/pull/89) Add rules for Norwegian (by [tsmes](https://github.com/tsmes))\n-   [#90](https://github.com/cocur/slugify/pull/90) Replace `bindShared` with `singleton` in Laravel bridge (by [sunspikes](https://github.com/sunspikes))\n-   [#97](https://github.com/cocur/slugify/pull/97) Set minimum PHP version to 5.5.9 (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#98](https://github.com/cocur/slugify/pull/98) Add rules for Bulgarian (by [RoumenDamianoff](https://github.com/RoumenDamianoff))\n\n### Version 1.4.1 (11 February 2016)\n\n-   [#90](https://github.com/cocur/slugify/pull/90) Replace `bindShared` with `singleton` in Laravel bridge (by [sunspikes](https://github.com/sunspikes))\n\n### Version 1.4 (29 September 2015)\n\n-   [#75](https://github.com/cocur/slugify/pull/75) Remove a duplicate array entry (by [irfanevrens](https://github.com/irfanevrens))\n-   [#76](https://github.com/cocur/slugify/pull/76) Add support for Georgian (by [TheGIBSON](https://github.com/TheGIBSON))\n-   [#77](https://github.com/cocur/slugify/pull/77) Fix Danish transliterations (by [kafoso](https://github.com/kafoso))\n\n### Version 1.3 (2 September 2015)\n\n-   [#70](https://github.com/cocur/slugify/pull/70) Add missing superscript and subscript digits (by [BlueM](https://github.com/BlueM))\n-   [#71](https://github.com/cocur/slugify/pull/71) Improve Greek language support (by [kostaspt](https://github.com/kostaspt))\n-   [#72](https://github.com/cocur/slugify/pull/72) Improve Silex integration (by [CarsonF](https://github.com/CarsonF))\n-   [#73](https://github.com/cocur/slugify/pull/73) Improve Russian language support (by [akost](https://github.com/akost))\n\n### Version 1.2 (2 July 2015)\n\n-   Add integration for [Plum](https://github.com/plumphp/plum) (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   [#64](https://github.com/cocur/slugify/pull/64) Fix Nette integration (by [lookyman](https://github.com/lookyman))\n-   Add option to not convert slug to lowercase (by [florianeckerstorfer](https://github.com/florianeckerstorfer) and [GDmac](https://github.com/GDmac))\n\n### Version 1.1 (18 March 2015)\n\n-   [#54](https://github.com/cocur/slugify/pull/54) Add support for Burmese characters (by [lovetostrike](https://github.com/lovetostrike))\n-   [#58](https://github.com/cocur/slugify/pull/58) Add Nette and Latte integration (by [lookyman](https://github.com/lookyman))\n-   [#50](https://github.com/cocur/slugify/issues/50) Fix transliteration for Vietnamese character Đ (by [mac2000](https://github.com/mac2000))\n\n### Version 1.0 (26 November 2014)\n\nNo new features or bugfixes, but it's about time to pump Slugify to v1.0.\n\n### Version 0.11 (23 November 2014)\n\n-   [#49](https://github.com/cocur/slugify/pull/49) Add Zend Framework 2 integration (by [acelaya](https://github.com/acelaya))\n\n### Version 0.10.3 (8 November 2014)\n\n-   [#48](https://github.com/cocur/slugify/pull/48) Add support for Vietnamese (by [mac2000](https://github.com/mac2000))\n\n### Version 0.10.2 (18 October 2014)\n\n-   [#44](https://github.com/cocur/slugify/pull/44) Change visibility of properties to `protected` (by [acelaya](https://github.com/acelaya))\n-   [#45](https://github.com/cocur/slugify/pull/45) Configure regular expression used to replace characters (by [acelaya](https://github.com/acelaya))\n-   Fix type hinting (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n-   Remove duplicate rule (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n\n### Version 0.10.1 (1 September 2014)\n\n-   [#39](https://github.com/cocur/slugify/pull/39) Add support for rulesets (by [florianeckerstorfer](https://github.com/florianeckerstorfer))\n\n### Version 0.10.0 (26 August 2014)\n\n-   [#32](https://github.com/cocur/slugify/pull/32) Added Laraval bridge (by [cviebrock](https://github.com/cviebrock))\n-   [#35](https://github.com/cocur/slugify/pull/35) Fixed transliteration for `Ď` (by [michalskop](https://github.com/michalskop))\n\n### Version 0.9 (29 May 2014)\n\n-   [#28](https://github.com/cocur/slugify/pull/28) Add Symfony2 service alias and make Twig extension private (by [Kevin Bond](https://github.com/kbond))\n\n### Version 0.8 (18 April 2014)\n\n-   [#27](https://github.com/cocur/slugify/pull/27) Add support for Arabic characters (by [Davide Bellini](https://github.com/billmn))\n-   Added some missing characters\n-   Improved organisation of characters in `Slugify` class\n\n### Version 0.7 (4 April 2014)\n\nThis version introduces optional integrations into Symfony2, Silex and Twig. You can still use the library in any other framework. I decided to include these bridges because there exist integrations from other developers, but they use outdated versions of cocur/slugify. Including these small bridge classes in the library makes maintaining them a lot easier for me.\n\n-   [#23](https://github.com/cocur/slugify/pull/23) Added Symfony2 service\n-   [#24](https://github.com/cocur/slugify/pull/24) Added Twig extension\n-   [#25](https://github.com/cocur/slugify/pull/25) Added Silex service provider\n\n### Version 0.6 (2 April 2014)\n\n-   [#22](https://github.com/cocur/slugify/pull/22) Added support for Esperanto characters (by [Michel Petit](https://github.com/malenkiki))\n\n### Version 0.5 (28 March 2014)\n\n-   [#21](https://github.com/cocur/slugify/pull/21) Added support for Greek characters (by [Michel Petit](https://github.com/malenkiki))\n-   [#20](https://github.com/cocur/slugify/pull/20) Fixed rule for cyrillic letter D (by [Marchenko Alexandr](https://github.com/cocur/slugify/pull/20))\n-   Add missing `$separator` parameter to `SlugifyInterface`\n\n### Version 0.4.1 (9 March 2014)\n\n-   [#19](https://github.com/cocur/slugify/pull/19) Adds soft sign rule (by [Marchenko Alexandr](https://github.com/mac2000))\n\n### Version 0.4 (17 January 2014)\n\nNearly completely rewritten code, removes `iconv` support because the underlying library is broken. The code is now better and faster. Many thanks to [Marchenko Alexandr](http://mac-blog.org.ua).\n\n### Version 0.3 (12 January 2014)\n\n-   [#11](https://github.com/cocur/slugify/pull/11) PSR-4 compatible (by [mac2000](https://github.com/mac2000))\n-   [#13](https://github.com/cocur/slugify/pull/13) Added editorconfig (by [mac2000](https://github.com/mac2000))\n-   [#14](https://github.com/cocur/slugify/pull/14) Return empty slug when input is empty and removed unused parameter (by [mac2000](https://github.com/mac2000))\n\n## Authors\n\n-   [Florian Eckerstorfer](http://florian.ec) ([Twitter](http://twitter.com/Florian_))\n-   [Ivo Bathke](https://github.com/ivoba)\n-   [Marchenko Alexandr](http://mac-blog.org.ua)\n-   And many [great contributors](https://github.com/cocur/slugify/graphs/contributors)\n\nSupport for Chinese is adapted from [jifei/Pinyin](https://github.com/jifei/Pinyin) with permission.\n\n\u003e Slugify is a project of [Cocur](http://cocur.co). You can contact us on Twitter:\n\u003e [**@cocurco**](https://twitter.com/cocurco)\n\n## Support\n\nIf you need support you can ask on [Twitter](https://twitter.com/cocurco) (well, only if your question is short) or you\ncan join our chat on Gitter.\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cocur/slugify)\n\nIn case you want to support the development of Slugify you can help us with providing additional transliterations or\ninform us if a transliteration is wrong. We would highly appreciate it if you can send us directly a Pull Request on\nGithub. If you have never contributed to a project on Github we are happy to help you. Just ask on Twitter or directly\njoin our Gitter.\n\nYou always can help me (Florian, the original developer and maintainer) out by\n[sending me an Euro or two](https://paypal.me/florianec/2).\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2012-2017 Florian Eckerstorfer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocur%2Fslugify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcocur%2Fslugify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocur%2Fslugify/lists"}