PHP Class Cocur\Slugify\Slugify

Author: Florian Eckerstorfer ([email protected])
Author: Ivo Bathke ([email protected])
Author: Marchenko Alexandr
Inheritance: implements Cocur\Slugify\SlugifyInterface
Exibir arquivo Open project: cocur/slugify Class Usage Examples

Protected Properties

Property Type Description
$options mixed>\array
$provider Cocur\Slugify\RuleProvider\RuleProviderInterface
$rules string>\array

Public Methods

Method Description
__construct ( array $options = [], Cocur\Slugify\RuleProvider\RuleProviderInterface $provider = null )
activateRuleSet ( string $ruleSet ) : Slugify
addRule ( string $character, string $replacement ) : Slugify Adds a custom rule to Slugify.
addRules ( array $rules ) : Slugify Adds multiple rules to Slugify.
create ( array $options = [] ) : Slugify Static method to create new instance of {@see Slugify}.
slugify ( string $string, string | array | null $options = null ) : string Returns the slug-version of the string.

Method Details

__construct() public method

public __construct ( array $options = [], Cocur\Slugify\RuleProvider\RuleProviderInterface $provider = null )
$options array
$provider Cocur\Slugify\RuleProvider\RuleProviderInterface

activateRuleSet() public method

public activateRuleSet ( string $ruleSet ) : Slugify
$ruleSet string
return Slugify

addRule() public method

Adds a custom rule to Slugify.
public addRule ( string $character, string $replacement ) : Slugify
$character string Character
$replacement string Replacement character
return Slugify

addRules() public method

Adds multiple rules to Slugify.
public addRules ( array $rules ) : Slugify
$rules array
return Slugify

create() public static method

Static method to create new instance of {@see Slugify}.
public static create ( array $options = [] ) : Slugify
$options array
return Slugify

slugify() public method

Returns the slug-version of the string.
public slugify ( string $string, string | array | null $options = null ) : string
$string string String to slugify
$options string | array | null Options
return string Slugified version of the string

Property Details

$options protected_oe property

protected array $options
return mixed>\array

$provider protected_oe property

protected RuleProviderInterface,Cocur\Slugify\RuleProvider $provider
return Cocur\Slugify\RuleProvider\RuleProviderInterface

$rules protected_oe property

protected array $rules
return string>\array