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
public
mixed
CASE_CAMEL
= 1 << 0
CASE_CAMEL_LOWER
public
mixed
CASE_CAMEL_LOWER
= self::CASE_CAMEL
CASE_CAMEL_UPPER
public
mixed
CASE_CAMEL_UPPER
= self::CASE_CAMEL | 1 << 1
CASE_LOWER
public
mixed
CASE_LOWER
= 0
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
stringgetCaseProcessing()
Get camel case processing
public
getCaseProcessing() : int
Return values
intgetMaxLength()
public
getMaxLength() : int|null
Return values
int|nullisCamelCaseProcessing()
Is this generator camel case processing ?
public
isCamelCaseProcessing() : bool
Return values
boolisRemovingSpaces()
Is this generator removing spaces ?
public
isRemovingSpaces() : bool
Return values
boolsetCaseProcessing()
Set camel case processing
public
setCaseProcessing(int $caseProcessing) : static
Parameters
- $caseProcessing : int
Return values
staticsetMaxLength()
public
setMaxLength(int|null $maxLength) : static
Parameters
- $maxLength : int|null
Return values
staticsetRemoveSpaces()
Set removing spaces
public
setRemoveSpaces([bool $removeSpaces = true ]) : static
Parameters
- $removeSpaces : bool = true