PHP Class Calotype\SEO\Generators\MetaGenerator

Show file Open project: calotype/seo

Protected Properties

Property Type Description
$canonical array The canonical url.
$defaults * The default configurations.
$description string The meta description.
$keywords string The meta keywords.
$max_description_length integer The maximal length of the meta description.
$title string The meta title.

Public Methods

Method Description
__construct ( array $defaults = [] ) Create a new MetaGenerator instance.
fromObject ( Calotype\SEO\Contracts\MetaAware $object ) Use the meta data of a MetaAware object.
generate ( ) : string Render the meta tags.
getCanonical ( ) : string Get the canonical url.
getDefault ( string $default ) : mixed Get a default configuration.
getDescription ( ) : string Get the Meta description.
getKeywords ( ) : string Get the Meta keywords.
getTitle ( ) : string Get the Meta title.
reset ( ) : void Reset the title and description fields.
setCanonical ( string $url ) Set the canonical url.
setDescription ( string $description ) Set the Meta description.
setKeywords ( array | string $keywords ) Set the Meta keywords.
setTitle ( string $title ) Set the Meta title.

Method Details

__construct() public method

Create a new MetaGenerator instance.
public __construct ( array $defaults = [] )
$defaults array

fromObject() public method

Use the meta data of a MetaAware object.
public fromObject ( Calotype\SEO\Contracts\MetaAware $object )
$object Calotype\SEO\Contracts\MetaAware

generate() public method

Render the meta tags.
public generate ( ) : string
return string

getCanonical() public method

Get the canonical url.
public getCanonical ( ) : string
return string

getDefault() public method

Get a default configuration.
public getDefault ( string $default ) : mixed
$default string
return mixed

getDescription() public method

Get the Meta description.
public getDescription ( ) : string
return string

getKeywords() public method

Get the Meta keywords.
public getKeywords ( ) : string
return string

getTitle() public method

Get the Meta title.
public getTitle ( ) : string
return string

reset() public method

Reset the title and description fields.
public reset ( ) : void
return void

setCanonical() public method

Set the canonical url.
public setCanonical ( string $url )
$url string

setDescription() public method

Set the Meta description.
public setDescription ( string $description )
$description string

setKeywords() public method

Set the Meta keywords.
public setKeywords ( array | string $keywords )
$keywords array | string

setTitle() public method

Set the Meta title.
public setTitle ( string $title )
$title string

Property Details

$canonical protected property

The canonical url.
protected array $canonical
return array

$defaults protected property

* The default configurations.
protected $defaults

$description protected property

The meta description.
protected string $description
return string

$keywords protected property

The meta keywords.
protected string $keywords
return string

$max_description_length protected property

The maximal length of the meta description.
protected int $max_description_length
return integer

$title protected property

The meta title.
protected string $title
return string