PHP Class Arcanedev\SeoHelper\SeoMeta

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

Protected Properties

Property Type Description
$analytics Arcanedev\SeoHelper\Contracts\Entities\Analytics The Analytics instance.
$currentUrl string Current URL.
$description Arcanedev\SeoHelper\Contracts\Entities\Description The Description instance.
$keywords Arcanedev\SeoHelper\Contracts\Entities\Keywords The Keywords instance.
$misc Arcanedev\SeoHelper\Contracts\Entities\MiscTags The MiscTags instance.
$title Arcanedev\SeoHelper\Contracts\Entities\Title The Title instance.
$webmasters Arcanedev\SeoHelper\Contracts\Entities\Webmasters The Webmasters instance.

Public Methods

Method Description
__construct ( array $configs ) Make SeoMeta instance.
__toString ( ) : string Render all seo tags.
addKeyword ( string $keyword ) : SeoMeta Add a keyword.
addKeywords ( array $keywords ) : SeoMeta Add many keywords.
addMeta ( string $name, string $content ) : SeoMeta Add a meta tag.
addMetas ( array $metas ) : SeoMeta Add many meta tags.
addWebmaster ( string $webmaster, string $content ) : SeoMeta Add a webmaster tool site verifier.
description ( Arcanedev\SeoHelper\Contracts\Entities\Description $description ) : SeoMeta Set the Description instance.
keywords ( Arcanedev\SeoHelper\Contracts\Entities\Keywords $keywords ) : SeoMeta Set the Keywords instance.
misc ( Arcanedev\SeoHelper\Contracts\Entities\MiscTags $misc ) : SeoMeta Set the MiscTags instance.
removeMeta ( string | array $names ) : SeoMeta Remove a meta from the meta collection by key.
render ( ) : string Render all seo tags.
resetMetas ( ) : SeoMeta Reset the meta collection except the description and keywords metas.
resetWebmasters ( ) : SeoMeta Reset all webmaster tool site verifier metas.
setDescription ( string $content ) : SeoMeta Set the description content.
setGoogleAnalytics ( string $code ) : SeoMeta Set the Google Analytics code.
setKeywords ( array | string $content ) : SeoMeta Set the keywords content.
setSiteName ( string $siteName ) : self Set the site name.
setTitle ( string $title, string $siteName = null, string $separator = null ) : SeoMeta Set the title.
setUrl ( string $url ) : SeoMeta Set the current URL.
title ( Arcanedev\SeoHelper\Contracts\Entities\Title $title ) : SeoMeta Set the Title instance.
webmasters ( Arcanedev\SeoHelper\Contracts\Entities\Webmasters $webmasters ) : SeoMeta Set the Webmasters instance.

Private Methods

Method Description
analytics ( Arcanedev\SeoHelper\Contracts\Entities\Analytics $analytics ) : SeoMeta Set the Analytics instance.
init ( ) Start the engine.

Method Details

__construct() public method

Make SeoMeta instance.
public __construct ( array $configs )
$configs array

__toString() public method

Render all seo tags.
public __toString ( ) : string
return string

addKeyword() public method

Add a keyword.
public addKeyword ( string $keyword ) : SeoMeta
$keyword string
return SeoMeta

addKeywords() public method

Add many keywords.
public addKeywords ( array $keywords ) : SeoMeta
$keywords array
return SeoMeta

addMeta() public method

Add a meta tag.
public addMeta ( string $name, string $content ) : SeoMeta
$name string
$content string
return SeoMeta

addMetas() public method

Add many meta tags.
public addMetas ( array $metas ) : SeoMeta
$metas array
return SeoMeta

addWebmaster() public method

Add a webmaster tool site verifier.
public addWebmaster ( string $webmaster, string $content ) : SeoMeta
$webmaster string
$content string
return SeoMeta

description() public method

Set the Description instance.
public description ( Arcanedev\SeoHelper\Contracts\Entities\Description $description ) : SeoMeta
$description Arcanedev\SeoHelper\Contracts\Entities\Description
return SeoMeta

keywords() public method

Set the Keywords instance.
public keywords ( Arcanedev\SeoHelper\Contracts\Entities\Keywords $keywords ) : SeoMeta
$keywords Arcanedev\SeoHelper\Contracts\Entities\Keywords
return SeoMeta

misc() public method

Set the MiscTags instance.
public misc ( Arcanedev\SeoHelper\Contracts\Entities\MiscTags $misc ) : SeoMeta
$misc Arcanedev\SeoHelper\Contracts\Entities\MiscTags
return SeoMeta

removeMeta() public method

Remove a meta from the meta collection by key.
public removeMeta ( string | array $names ) : SeoMeta
$names string | array
return SeoMeta

render() public method

Render all seo tags.
public render ( ) : string
return string

resetMetas() public method

Reset the meta collection except the description and keywords metas.
public resetMetas ( ) : SeoMeta
return SeoMeta

resetWebmasters() public method

Reset all webmaster tool site verifier metas.
public resetWebmasters ( ) : SeoMeta
return SeoMeta

setDescription() public method

Set the description content.
public setDescription ( string $content ) : SeoMeta
$content string
return SeoMeta

setGoogleAnalytics() public method

Set the Google Analytics code.
public setGoogleAnalytics ( string $code ) : SeoMeta
$code string
return SeoMeta

setKeywords() public method

Set the keywords content.
public setKeywords ( array | string $content ) : SeoMeta
$content array | string
return SeoMeta

setSiteName() public method

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

setTitle() public method

Set the title.
public setTitle ( string $title, string $siteName = null, string $separator = null ) : SeoMeta
$title string
$siteName string
$separator string
return SeoMeta

setUrl() public method

Set the current URL.
public setUrl ( string $url ) : SeoMeta
$url string
return SeoMeta

title() public method

Set the Title instance.
public title ( Arcanedev\SeoHelper\Contracts\Entities\Title $title ) : SeoMeta
$title Arcanedev\SeoHelper\Contracts\Entities\Title
return SeoMeta

webmasters() public method

Set the Webmasters instance.
public webmasters ( Arcanedev\SeoHelper\Contracts\Entities\Webmasters $webmasters ) : SeoMeta
$webmasters Arcanedev\SeoHelper\Contracts\Entities\Webmasters
return SeoMeta

Property Details

$analytics protected property

The Analytics instance.
protected Analytics,Arcanedev\SeoHelper\Contracts\Entities $analytics
return Arcanedev\SeoHelper\Contracts\Entities\Analytics

$currentUrl protected property

Current URL.
protected string $currentUrl
return string

$description protected property

The Description instance.
protected Description,Arcanedev\SeoHelper\Contracts\Entities $description
return Arcanedev\SeoHelper\Contracts\Entities\Description

$keywords protected property

The Keywords instance.
protected Keywords,Arcanedev\SeoHelper\Contracts\Entities $keywords
return Arcanedev\SeoHelper\Contracts\Entities\Keywords

$misc protected property

The MiscTags instance.
protected MiscTags,Arcanedev\SeoHelper\Contracts\Entities $misc
return Arcanedev\SeoHelper\Contracts\Entities\MiscTags

$title protected property

The Title instance.
protected Title,Arcanedev\SeoHelper\Contracts\Entities $title
return Arcanedev\SeoHelper\Contracts\Entities\Title

$webmasters protected property

The Webmasters instance.
protected Webmasters,Arcanedev\SeoHelper\Contracts\Entities $webmasters
return Arcanedev\SeoHelper\Contracts\Entities\Webmasters