keyvanakbary / slugifier
A full-featured, simple, clean and pure functional implementation for creating slugs
Installs: 176 661
Dependents: 5
Suggesters: 0
Security: 0
Stars: 67
Watchers: 5
Forks: 7
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-12-21 17:58:57 UTC
README
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