https://github.com/keyvanakbary/slugifier
Just a simple, clean and pure functional implementation for creating slugs
https://github.com/keyvanakbary/slugifier
php slug slugifier
Last synced: 5 months ago
JSON representation
Just a simple, clean and pure functional implementation for creating slugs
- Host: GitHub
- URL: https://github.com/keyvanakbary/slugifier
- Owner: keyvanakbary
- License: mit
- Created: 2014-12-27T20:38:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-02T23:52:56.000Z (over 9 years ago)
- Last Synced: 2024-08-08T17:19:04.323Z (9 months ago)
- Topics: php, slug, slugifier
- Language: PHP
- Homepage:
- Size: 265 KB
- Stars: 67
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slugifier
[](http://travis-ci.org/keyvanakbary/slugifier)
A full-featured, simple, clean and pure functional implementation for creating [slugs](http://en.wikipedia.org/wiki/Semantic_URL#Slug). No third party libraries or extensions needed.
## Installation
``` bash
composer require keyvanakbary/slugifier
```## Usage
```php
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*
```php
s\slugify('Pingüino', '-', ['ü' => 'u']); // pinguino
```Some [language iso code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) modifiers are supported
```php
s\slugify('Estaĵo', '-', s\MOD['eo']); // estajxos\slugify('Örnektir', '-', s\MOD['tr']); // ornektir
```