PHP Class Arcanedev\SeoHelper\Entities\Title

Author: ARCANEDEV ([email protected])
Inheritance: implements Arcanedev\SeoHelper\Contracts\Entities\Title, use trait Arcanedev\Support\Traits\Configurable
Show file Open project: arcanedev/seo-helper

Protected Properties

Property Type Description
$max integer The maximum title length.
$separator string The title separator.
$siteName string The site name.
$title string The title content.
$titleFirst boolean Display the title first.

Public Methods

Method Description
__construct ( array $configs = [] ) Make the Title instance.
__toString ( ) : string Render the tag.
getMax ( ) : integer Get title max length.
getSeparator ( ) : string Get title separator.
getSiteName ( ) : string Get site name.
getTitleOnly ( ) : string Get title only (without site name or separator).
isTitleFirst ( ) : boolean Check if title is first.
make ( string $title, string $siteName = '', string $separator = '-' ) : Title Make a Title instance.
render ( ) : string Render the tag.
set ( string $title ) : Title Set title.
setFirst ( ) : Title Set title first.
setLast ( ) : Title Set title last.
setMax ( integer $max ) : Title Set title max length.
setSeparator ( string $separator ) : Title Set title separator.
setSiteName ( string $siteName ) : Title Set site name.

Protected Methods

Method Description
renderSeparator ( ) : string Render the separator.

Private Methods

Method Description
checkMax ( integer $max ) Check title max length.
checkTitle ( string &$title ) Check title.
hasSiteName ( ) : boolean Check if site name exists.
init ( ) Start the engine.
prepareTitleOutput ( string $output ) : string Prepare the title output.
renderTitleFirst ( string $separator ) : string Render title first.
renderTitleLast ( string $separator ) : string Render title last.
switchPosition ( boolean $first ) : Title Switch title position.

Method Details

__construct() public method

Make the Title instance.
public __construct ( array $configs = [] )
$configs array

__toString() public method

Render the tag.
public __toString ( ) : string
return string

getMax() public method

Get title max length.
public getMax ( ) : integer
return integer

getSeparator() public method

Get title separator.
public getSeparator ( ) : string
return string

getSiteName() public method

Get site name.
public getSiteName ( ) : string
return string

getTitleOnly() public method

Get title only (without site name or separator).
public getTitleOnly ( ) : string
return string

isTitleFirst() public method

Check if title is first.
public isTitleFirst ( ) : boolean
return boolean

make() public static method

Make a Title instance.
public static make ( string $title, string $siteName = '', string $separator = '-' ) : Title
$title string
$siteName string
$separator string
return Title

render() public method

Render the tag.
public render ( ) : string
return string

renderSeparator() protected method

Render the separator.
protected renderSeparator ( ) : string
return string

set() public method

Set title.
public set ( string $title ) : Title
$title string
return Title

setFirst() public method

Set title first.
public setFirst ( ) : Title
return Title

setLast() public method

Set title last.
public setLast ( ) : Title
return Title

setMax() public method

Set title max length.
public setMax ( integer $max ) : Title
$max integer
return Title

setSeparator() public method

Set title separator.
public setSeparator ( string $separator ) : Title
$separator string
return Title

setSiteName() public method

Set site name.
public setSiteName ( string $siteName ) : Title
$siteName string
return Title

Property Details

$max protected property

The maximum title length.
protected int $max
return integer

$separator protected property

The title separator.
protected string $separator
return string

$siteName protected property

The site name.
protected string $siteName
return string

$title protected property

The title content.
protected string $title
return string

$titleFirst protected property

Display the title first.
protected bool $titleFirst
return boolean