2017 © Pedro Peláez
 

library slugify

Coercive Slugify Utility

image

coercive/slugify

Coercive Slugify Utility

  • Monday, June 4, 2018
  • by Coercive
  • Repository
  • 1 Watchers
  • 2 Stars
  • 786 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 18 % Grown

The README.md

Coercive Slugify Utility

Slugify allows you to clean the characters in a string for treatment of URL rewriting for example. Other options can detect proper names, clean spaces, move text into utf8 etc ..., (*1)

Get

composer require coercive/slugify

Usage

URL, (*2)

use Coercive\Utility\Slugify;

$sTitleArticle = 'My title is not made to work with a URL rewriting directly, it must be processed before.';
$sSlug = (new Slugify)->clean($sTitleArticle);

# GIVE : my-title-is-not-made-to-work-with-a-url-rewriting-directly-it-must-be-processed-before

SUMMARY, (*3)

use Coercive\Utility\Slugify;

$sText = 'Long text ... Very Long Text ...';
$sSummary = (new Slugify)->substrText($sText);

# GIVE : 300chars text

$sSummary = (new Slugify)->substrText($sText, 500);

# GIVE : 500chars text

NAME, (*4)

use Coercive\Utility\Slugify;

$sName = 'Mary Antoinette';
$bIsName = (new Slugify)->pregName($sName);

# True

$sName = '@Not A valid name !';
$bIsName = (new Slugify)->pregName($sName);

# False

TO UTF8, (*5)

use Coercive\Utility\Slugify;

$sString = '!W~"·øΥψ';
$sUtf8String = (new Slugify)->toUTF8($sString);

The Versions

04/06 2018

dev-master

9999999-dev http://coercive.fr

Coercive Slugify Utility

  Sources   Download

MIT GNU

The Requires

  • php >=5.4.0

 

04/06 2018

1.1.5

1.1.5.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

24/05 2018

1.1.4

1.1.4.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

07/02 2018

1.1.3

1.1.3.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

21/08 2017

1.1.2

1.1.2.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0

 

21/08 2017

1.1.1

1.1.1.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0

 

11/02 2017

1.1.0

1.1.0.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0

 

10/07 2016

1.0.0

1.0.0.0 http://coercive.fr

Coercive Slugify Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0