keyvanakbary / slugifier

Just a simple, clean and pure functional implementation for creating slugs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slugifier

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

About

Just a simple, clean and pure functional implementation for creating slugs

License:MIT License


Languages

Language:PHP 100.0%