Skip to content

Pyton/EasySlug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasySlug

Description

EasySlug is very simple class to making slug from base text.

Instalation

Using Composer, just require the pyton/easyslug package:

{
    "require": {
        "pyton/easyslug": "~1.0"
    }
}

Usage

$easySlug = new EasySlug();

$string = 'Base Slug string.';
$slug = $easySlug->create($string);

echo $slug->plain() . PHP_EOL;
// base-slug-string

echo $slug->format('%s.html') . PHP_EOL;
// base-slug-string.html

$easySlug->setReplacement('_');
$slug = $easySlug->create($string);
echo $slug->plain() . PHP_EOL;
// base_slug_string

echo $slug->format('%s.html') . PHP_EOL;
// base_slug_string.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages