keyvanakbary/slugifier

A full-featured, simple, clean and pure functional implementation for creating slugs

v4.0.0 2015-08-02 23:48 UTC

This package is not auto-updated.

Last update: 2024-11-09 17:30:10 UTC


README

Build Status

A full-featured, simple, clean and pure functional implementation for creating slugs. No third party libraries or extensions needed.

Installation

composer require keyvanakbary/slugifier

Usage

use slugifier as s;

s\slugify('JúST å fëw wørds'); // just-a-few-words

s\slugify('Αυτή είναι μια δοκιμή'); // ayti-einai-mia-dokimi

s\slugify('Wikipedia style', '_'); // wikipedia_style

Modifiers

Sometimes the default character map is not accurate enough. Slugifier supports custom modifiers

s\slugify('Pingüino', '-', ['ü' => 'u']); // pinguino

Some language iso code modifiers are supported

s\slugify('Estaĵo', '-', s\MOD['eo']); // estajxo

s\slugify('Örnektir', '-', s\MOD['tr']); // ornektir