Orpheus

SlugGenerator
in package

The Slug Generator class

This class generate slug

Table of Contents

Constants

CASE_CAMEL  = 1 << 0
CASE_CAMEL_LOWER  = self::CASE_CAMEL
CASE_CAMEL_UPPER  = self::CASE_CAMEL | 1 << 1
CASE_LOWER  = 0

Properties

$caseProcessing  : int
How to process word case
$maxLength  : int|null
Max length to truncate
$removeSpaces  : bool
Should remove space instead of replacing them

Methods

format()  : string
Format the $string
getCaseProcessing()  : int
Get camel case processing
getMaxLength()  : int|null
isCamelCaseProcessing()  : bool
Is this generator camel case processing ?
isRemovingSpaces()  : bool
Is this generator removing spaces ?
setCaseProcessing()  : static
Set camel case processing
setMaxLength()  : static
setRemoveSpaces()  : static
Set removing spaces

Constants

CASE_CAMEL_LOWER

public mixed CASE_CAMEL_LOWER = self::CASE_CAMEL

CASE_CAMEL_UPPER

public mixed CASE_CAMEL_UPPER = self::CASE_CAMEL | 1 << 1

Properties

$caseProcessing

How to process word case

protected int $caseProcessing = self::CASE_CAMEL_UPPER

$maxLength

Max length to truncate

protected int|null $maxLength = null

$removeSpaces

Should remove space instead of replacing them

protected bool $removeSpaces = false

Methods

format()

Format the $string

public format(string $string) : string
Parameters
$string : string
Return values
string

getCaseProcessing()

Get camel case processing

public getCaseProcessing() : int
Return values
int

getMaxLength()

public getMaxLength() : int|null
Return values
int|null

isCamelCaseProcessing()

Is this generator camel case processing ?

public isCamelCaseProcessing() : bool
Return values
bool

isRemovingSpaces()

Is this generator removing spaces ?

public isRemovingSpaces() : bool
Return values
bool

setCaseProcessing()

Set camel case processing

public setCaseProcessing(int $caseProcessing) : static
Parameters
$caseProcessing : int
Return values
static

setMaxLength()

public setMaxLength(int|null $maxLength) : static
Parameters
$maxLength : int|null
Return values
static

setRemoveSpaces()

Set removing spaces

public setRemoveSpaces([bool $removeSpaces = true ]) : static
Parameters
$removeSpaces : bool = true
Return values
static

							
On this page

Search results