php-extended / php-slugifier-ascii-transliterator
A slugifier that does ascii transliterations of unicode text
Requires
- php: >=7.1
- php-extended/php-slugifier-object: ^4
- php-extended/polyfill-php80-stringable: >=1
Requires (Dev)
README
A slugifier that does ascii transliterations of unicode text. This library is inspired by martinml's implementation of transliterator and the original python implementation.
This library transliterates the given strings, but is not compatible with the other implementations based on the same tables. This library does only the transliteration and still contains symbols. For a narrower slugification process, this slugifier should be chained with another slugifiers like AsciiCut and Lower.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-slugifier-ascii-transliterator": "^3",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
You may use this library the following way :
use PhpExtended\Slugifier\AsciiTransliteratorSlugifier;
$slugifier = new AsciiTransliteratorSlugifier();
$slug = $slugifier->slugify('<string data>');
License
Original character transliteration tables:
Copyright 2001, Sean M. Burke sburke@cpan.org, all rights reserved.
Python code and later additions:
Copyright 2019, Tomaz Solc tomaz.solc@tablix.org
More modifications on the tables by Anastaszor:
GPLv2 (See license file).
The rest of the code (/src) is:
MIT (See license file).