2017 © Pedro PelĂĄez
 

library urislug

image

urislug/urislug

  • Sunday, March 29, 2015
  • by adamelso
  • Repository
  • 0 Watchers
  • 0 Stars
  • 98 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

UriSlug [Deprecated]

Deprecated! Please use URLify instead., (*1)

Overview

Canonicalizes a string to a URL-friendly format. Based on a combination of WordPress functions., (*2)

Installation with Composer

Add to your composer.json, (*3)

{
    "require": {
        "urislug/urislug": "dev-master"
    }
}

Example Usage

    <?php

    require __DIR__.'/vendor/autoload.php';

    // Create as a new instance
    $greeting = new \UriSlug('Hello, there ^_^'); 

    // automatically casts to a string if treated as such
    echo $greeting; // prints 'hello-there-_'

    // same as above
    echo $greeting->getSlug(); 

    // Factory method creates new instance with the given text and returns the slug string
    echo \UriSlug::create('Welcome to Großröhrsdorf!!1!one!'); // prints 'welcome-to-grosrohrsdorf1one';

License

As this is based on functions found in WordPress 3, and WordPress is released under the GPL v2 license, so is this helper class., (*4)

The Versions

29/03 2015

dev-master

9999999-dev

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.3