2017 © Pedro PelĂĄez
 

library slugifier

A simple php library to generate slugs.

image

jaenmedina/slugifier

A simple php library to generate slugs.

  • Friday, April 24, 2015
  • by jaenmedina
  • Repository
  • 1 Watchers
  • 2 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Slugifier

Build Status Codacy Badge Code Climate, (*1)

A simple php library to generate slugs., (*2)

Version

0.3.1, (*3)

Install with composer

Add the package dependency jaenmedina/slugifier in your composer.json, (*4)

{
    "require": {
        "jaenmedina/slugifier": "0.3.1"
    }
}

How to use?

Just instantiate the Slugifier class and call the slugify method. For example:, (*5)

$slugifier = new Slugifier();
$slug = $slugifier->slugify("Hello, world!");
echo $slug; // prints "hello-world"

If you want to set the separator just use the setSeparator function:, (*6)

$slugifier = new Slugifier();
$slugifier->setSeparator("_");
$slug = $slugifier->slugify("Hello, world!");
echo $slug; // prints "hello_world"

If you want to exclude certain words from the slug you can use the excludeWords function:, (*7)

$slugifier = new Slugifier();
$slugifier->excludeWords(["world", "How", "is"]);
$slug = $slugifier->slugify("Hello, world! How is everybody?");
echo $slug; // prints "hello-everybody"

To add specific mapping rules you can use the addRule, addRules and setRules functions:, (*8)

$slugifier = new Slugifier();
$slugifier->setRules(["Ă©" => "e"]);
$slugifier->addRule("ñ", "n");
$slugifier->addRules(["ĂŒ" => "u"]);
$slug = $slugifier->slugify("IntentĂ© Español PingĂŒino");
echo $slug; // prints "intente-espanol-pinguino"

License

MIT, (*9)

The Versions

24/04 2015

dev-master

9999999-dev http://www.slugifier.com

A simple php library to generate slugs.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Jaen Medina

php slug slugify slugifier

09/04 2015

0.3.0

0.3.0.0 http://www.slugifier.com

A simple php library to generate slugs.

  Sources   Download

MIT

The Requires

  • php >=5.4.3

 

The Development Requires

by Jaen Medina

php slug slugify slugifier

09/04 2015

0.2.0

0.2.0.0 http://www.slugifier.com

A simple php library to generate slugs.

  Sources   Download

MIT

The Requires

  • php >=5.4.3

 

The Development Requires

by Jaen Medina

php slug slugify slugifier

09/04 2015

0.1.0

0.1.0.0 http://www.slugifier.com

A simple php library to generate slugs.

  Sources   Download

MIT

The Requires

  • php >=5.4.3

 

The Development Requires

by Jaen Medina

php slug slugify slugifier