PHP Interface Artesaos\SEOTools\Contracts\MetaTags

Exibir arquivo Open project: artesaos/seotools

Public Methods

Method Description
__construct ( array $config = [] ) Configuration.
addAlternateLanguage ( string $lang, string $url ) Add an alternate language.
addAlternateLanguages ( array $languages ) : Artesaos\SEOTools\Contracts\MetaTags Add alternate languages.
addKeyword ( string | array $keyword ) : Artesaos\SEOTools\Contracts\MetaTags Add a keyword.
addMeta ( string | array $meta, string $value = null, string $name = 'name' ) : Artesaos\SEOTools\Contracts\MetaTags Add a custom meta tag.
generate ( boolean $minify = false ) : string Generates meta tags.
getAlternateLanguages ( ) : array Get alternate languages.
getCanonical ( ) : string Get the canonical URL.
getDefaultTitle ( ) : string Takes the default title.
getDescription ( ) : string Get the Meta description.
getKeywords ( ) : array Get the Meta keywords.
getMetatags ( ) : array Get all metatags.
getNext ( ) : string Get the next URL.
getPrev ( ) : string Get the prev URL.
getTitle ( ) : string Get the title formatted for display.
getTitleSeparator ( ) : string Get the title separator that was set.
getTitleSession ( ) : string Get the title that was set.
removeMeta ( string $key ) : Artesaos\SEOTools\Contracts\MetaTags Remove a metatag.
reset ( ) : void Reset all data.
setCanonical ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags Sets the canonical URL.
setDescription ( string $description ) : Artesaos\SEOTools\Contracts\MetaTags Set the description.
setKeywords ( array $keywords ) : Artesaos\SEOTools\Contracts\MetaTags Sets the list of keywords, you can send an array or string separated with commas also clears the previously set keywords.
setNext ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags Sets the next URL.
setPrev ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags Sets the prev URL.
setTitle ( string $title, boolean $appendDefault = true ) : Artesaos\SEOTools\Contracts\MetaTags Set the title.
setTitleDefault ( string $default ) : Artesaos\SEOTools\Contracts\MetaTags Sets the default title tag.
setTitleSeparator ( string $separator ) : Artesaos\SEOTools\Contracts\MetaTags Set the title separator.

Method Details

__construct() public method

Configuration.
public __construct ( array $config = [] )
$config array

addAlternateLanguage() public method

Add an alternate language.
public addAlternateLanguage ( string $lang, string $url )
$lang string language code in format ISO 639-1
$url string

addAlternateLanguages() public method

Add alternate languages.
public addAlternateLanguages ( array $languages ) : Artesaos\SEOTools\Contracts\MetaTags
$languages array
return Artesaos\SEOTools\Contracts\MetaTags

addKeyword() public method

Add a keyword.
public addKeyword ( string | array $keyword ) : Artesaos\SEOTools\Contracts\MetaTags
$keyword string | array
return Artesaos\SEOTools\Contracts\MetaTags

addMeta() public method

Add a custom meta tag.
public addMeta ( string | array $meta, string $value = null, string $name = 'name' ) : Artesaos\SEOTools\Contracts\MetaTags
$meta string | array
$value string
$name string
return Artesaos\SEOTools\Contracts\MetaTags

generate() public method

Generates meta tags.
public generate ( boolean $minify = false ) : string
$minify boolean
return string

getAlternateLanguages() public method

Get alternate languages.
public getAlternateLanguages ( ) : array
return array

getCanonical() public method

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

getDefaultTitle() public method

Takes the default title.
public getDefaultTitle ( ) : string
return string

getDescription() public method

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

getKeywords() public method

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

getMetatags() public method

Get all metatags.
public getMetatags ( ) : array
return array

getNext() public method

Get the next URL.
public getNext ( ) : string
return string

getPrev() public method

Get the prev URL.
public getPrev ( ) : string
return string

getTitle() public method

Get the title formatted for display.
public getTitle ( ) : string
return string

getTitleSeparator() public method

Get the title separator that was set.
public getTitleSeparator ( ) : string
return string

getTitleSession() public method

Get the title that was set.
public getTitleSession ( ) : string
return string

removeMeta() public method

Remove a metatag.
public removeMeta ( string $key ) : Artesaos\SEOTools\Contracts\MetaTags
$key string
return Artesaos\SEOTools\Contracts\MetaTags

reset() public method

Reset all data.
public reset ( ) : void
return void

setCanonical() public method

Sets the canonical URL.
public setCanonical ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags
$url string
return Artesaos\SEOTools\Contracts\MetaTags

setDescription() public method

Set the description.
public setDescription ( string $description ) : Artesaos\SEOTools\Contracts\MetaTags
$description string
return Artesaos\SEOTools\Contracts\MetaTags

setKeywords() public method

Sets the list of keywords, you can send an array or string separated with commas also clears the previously set keywords.
public setKeywords ( array $keywords ) : Artesaos\SEOTools\Contracts\MetaTags
$keywords array
return Artesaos\SEOTools\Contracts\MetaTags

setNext() public method

Sets the next URL.
public setNext ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags
$url string
return Artesaos\SEOTools\Contracts\MetaTags

setPrev() public method

Sets the prev URL.
public setPrev ( string $url ) : Artesaos\SEOTools\Contracts\MetaTags
$url string
return Artesaos\SEOTools\Contracts\MetaTags

setTitle() public method

Set the title.
public setTitle ( string $title, boolean $appendDefault = true ) : Artesaos\SEOTools\Contracts\MetaTags
$title string
$appendDefault boolean
return Artesaos\SEOTools\Contracts\MetaTags

setTitleDefault() public method

Sets the default title tag.
public setTitleDefault ( string $default ) : Artesaos\SEOTools\Contracts\MetaTags
$default string
return Artesaos\SEOTools\Contracts\MetaTags

setTitleSeparator() public method

Set the title separator.
public setTitleSeparator ( string $separator ) : Artesaos\SEOTools\Contracts\MetaTags
$separator string
return Artesaos\SEOTools\Contracts\MetaTags