zelenin/slugifier

This package is abandoned and no longer maintained. No replacement package was suggested.

Slug generation library

0.0.3 2015-07-31 16:00 UTC

This package is not auto-updated.

Last update: 2018-09-18 19:12:06 UTC


README

SEE STRING

Slugifier

Slug generation library

Installation

Composer

The preferred way to install this extension is through Composer.

Either run

php composer.phar require zelenin/slugifier "dev-master"

or add

"zelenin/slugifier": "dev-master"

to the require section of your composer.json

Usage

$string = 'test message';
$slug = (string) new \Zelenin\Slugifier\Slugifier($string);

You may set some options:

$string = 'test message';
$slugifier = new \Zelenin\Slugifier\Slugifier($string);
$slugifier->transliterateOptions = 'Russian-Latin/BGN; Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFKC; [:Punctuation:] Remove;';
$slugifier->replacement = '_';
$slugifier->lowercase = false;
$slug = $slugifier->getSlug();

Author

Aleksandr Zelenin, e-mail: aleksandr@zelenin.me