PHP Class Artesaos\SEOTools\OpenGraph

Inheritance: implements Artesaos\SEOTools\Contracts\OpenGraph
Afficher le fichier Open project: artesaos/seotools

Protected Properties

Свойство Type Description
$articleProperties array Array of Article Properties.
$audioProperties array Array of Audio Properties.
$bookProperties array Array of Book Properties.
$config array Config.
$images array Array of Image Properties.
$musicAlbumProperties array Array of Music Album Properties.
$musicPlaylistProperties array Array of Music Playlist Properties.
$musicRadioStationProperties array Array of Music Radio Properties.
$musicSongProperties array Array of Music Song Properties.
$og_prefix string OpenGraph Prefix.
$profileProperties array Array of Profile Properties.
$properties array Array of Properties.
$videoEpisodeProperties array Array of Video Episode Properties.
$videoMovieProperties array Array of Video Movie Properties.
$videoOtherProperties array Array of Video Other Properties.
$videoProperties array Array of Video Properties.
$videoTVShowProperties array Array of Video TV Show Properties.

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) : void Create a new OpenGraph instance.
addAudio ( string $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Add audio properties.
addImage ( mixed $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Add image to properties.
addImages ( array $urls ) : Artesaos\SEOTools\Contracts\OpenGraph Add images to properties.
addProperty ( string $key, string | array $value ) : Artesaos\SEOTools\Contracts\OpenGraph Add or update property.
addVideo ( string $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Add video properties.
generate ( boolean $minify = false ) : string Generates open graph tags.
removeProperty ( string $key ) : Artesaos\SEOTools\Contracts\OpenGraph Remove property.
setArticle ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set article properties.
setBook ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set book properties.
setDescription ( string $description = null ) : Artesaos\SEOTools\Contracts\OpenGraph Define description property.
setMusicAlbum ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set music album properties.
setMusicPlaylist ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set music playlist properties.
setMusicRadioStation ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set music radio station properties.
setMusicSong ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set music song properties.
setProfile ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set profile properties.
setSiteName ( string $name ) : Artesaos\SEOTools\Contracts\OpenGraph Define site_name property.
setTitle ( string $title = null ) : Artesaos\SEOTools\Contracts\OpenGraph Define title property.
setType ( string $type = null ) : Artesaos\SEOTools\Contracts\OpenGraph Define type property.
setUrl ( string $url ) : Artesaos\SEOTools\Contracts\OpenGraph Define url property.
setVideoEpisode ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set video episode properties.
setVideoMovie ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set video movie properties.
setVideoOther ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set video episode properties.
setVideoTVShow ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph Set video episode properties.

Méthodes protégées

Méthode Description
cleanProperties ( array $attributes = [], array $validKeys = [] ) : array Clean invalid properties.
eachProperties ( array $properties, null | string $prefix = null, boolean $ogPrefix = true ) : string Make list of open graph tags.
makeTag ( string $key = null, string $value = null, boolean $ogPrefix = false ) : string Make a og tag.
setProperties ( string $type = null, string $key = null, array $attributes = [], array $validKeys = [] ) : void Set properties.
setupDefaults ( ) : void Add or update property.

Method Details

__construct() public méthode

Create a new OpenGraph instance.
public __construct ( array $config = [] ) : void
$config array config
Résultat void

addAudio() public méthode

Add audio properties.
public addAudio ( string $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$source string url for audio source
$attributes array opengraph audio attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

addImage() public méthode

Add image to properties.
public addImage ( mixed $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$source mixed URL of image source
$attributes array Object type attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

addImages() public méthode

Add images to properties.
public addImages ( array $urls ) : Artesaos\SEOTools\Contracts\OpenGraph
$urls array array of image urls
Résultat Artesaos\SEOTools\Contracts\OpenGraph

addProperty() public méthode

Add or update property.
public addProperty ( string $key, string | array $value ) : Artesaos\SEOTools\Contracts\OpenGraph
$key string key of property
$value string | array value of property
Résultat Artesaos\SEOTools\Contracts\OpenGraph

addVideo() public méthode

Add video properties.
public addVideo ( string $source = null, array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$source string url of video source
$attributes array opengraph video attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

cleanProperties() protected méthode

Clean invalid properties.
protected cleanProperties ( array $attributes = [], array $validKeys = [] ) : array
$attributes array attributes input
$validKeys array keys that are allowed
Résultat array

eachProperties() protected méthode

Make list of open graph tags.
protected eachProperties ( array $properties, null | string $prefix = null, boolean $ogPrefix = true ) : string
$properties array array of properties
$prefix null | string prefix of property
$ogPrefix boolean opengraph prefix
Résultat string

generate() public méthode

Generates open graph tags.
public generate ( boolean $minify = false ) : string
$minify boolean
Résultat string

makeTag() protected méthode

Make a og tag.
protected makeTag ( string $key = null, string $value = null, boolean $ogPrefix = false ) : string
$key string meta property key
$value string meta property value
$ogPrefix boolean opengraph prefix
Résultat string

removeProperty() public méthode

Remove property.
public removeProperty ( string $key ) : Artesaos\SEOTools\Contracts\OpenGraph
$key string key
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setArticle() public méthode

Set article properties.
public setArticle ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph article attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setBook() public méthode

Set book properties.
public setBook ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph book attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setDescription() public méthode

Define description property.
public setDescription ( string $description = null ) : Artesaos\SEOTools\Contracts\OpenGraph
$description string set the opengraph description
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setMusicAlbum() public méthode

Set music album properties.
public setMusicAlbum ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph music.album attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setMusicPlaylist() public méthode

Set music playlist properties.
public setMusicPlaylist ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph music.playlist attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setMusicRadioStation() public méthode

Set music radio station properties.
public setMusicRadioStation ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph music.radio_station attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setMusicSong() public méthode

Set music song properties.
public setMusicSong ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph music.song attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setProfile() public méthode

Set profile properties.
public setProfile ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph profile attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setProperties() protected méthode

Set properties.
protected setProperties ( string $type = null, string $key = null, array $attributes = [], array $validKeys = [] ) : void
$type string type of og:type
$key string variable key
$attributes array inputted opengraph attributes
$validKeys array valid opengraph attributes
Résultat void

setSiteName() public méthode

Define site_name property.
public setSiteName ( string $name ) : Artesaos\SEOTools\Contracts\OpenGraph
$name string set the site_name
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setTitle() public méthode

Define title property.
public setTitle ( string $title = null ) : Artesaos\SEOTools\Contracts\OpenGraph
$title string set the opengraph title
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setType() public méthode

Define type property.
public setType ( string $type = null ) : Artesaos\SEOTools\Contracts\OpenGraph
$type string set the opengraph type
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setUrl() public méthode

Define url property.
public setUrl ( string $url ) : Artesaos\SEOTools\Contracts\OpenGraph
$url string set the opengraph url
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setVideoEpisode() public méthode

Set video episode properties.
public setVideoEpisode ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph video.episode attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setVideoMovie() public méthode

Set video movie properties.
public setVideoMovie ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph video.movie attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setVideoOther() public méthode

Set video episode properties.
public setVideoOther ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph video.other attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setVideoTVShow() public méthode

Set video episode properties.
public setVideoTVShow ( array $attributes = [] ) : Artesaos\SEOTools\Contracts\OpenGraph
$attributes array opengraph video.tv_show attributes
Résultat Artesaos\SEOTools\Contracts\OpenGraph

setupDefaults() protected méthode

Add or update property.
protected setupDefaults ( ) : void
Résultat void

Property Details

$articleProperties protected_oe property

Array of Article Properties.
protected array $articleProperties
Résultat array

$audioProperties protected_oe property

Array of Audio Properties.
protected array $audioProperties
Résultat array

$bookProperties protected_oe property

Array of Book Properties.
protected array $bookProperties
Résultat array

$config protected_oe property

Config.
protected array $config
Résultat array

$images protected_oe property

Array of Image Properties.
protected array $images
Résultat array

$musicAlbumProperties protected_oe property

Array of Music Album Properties.
protected array $musicAlbumProperties
Résultat array

$musicPlaylistProperties protected_oe property

Array of Music Playlist Properties.
protected array $musicPlaylistProperties
Résultat array

$musicRadioStationProperties protected_oe property

Array of Music Radio Properties.
protected array $musicRadioStationProperties
Résultat array

$musicSongProperties protected_oe property

Array of Music Song Properties.
protected array $musicSongProperties
Résultat array

$og_prefix protected_oe property

OpenGraph Prefix.
protected string $og_prefix
Résultat string

$profileProperties protected_oe property

Array of Profile Properties.
protected array $profileProperties
Résultat array

$properties protected_oe property

Array of Properties.
protected array $properties
Résultat array

$videoEpisodeProperties protected_oe property

Array of Video Episode Properties.
protected array $videoEpisodeProperties
Résultat array

$videoMovieProperties protected_oe property

Array of Video Movie Properties.
protected array $videoMovieProperties
Résultat array

$videoOtherProperties protected_oe property

Array of Video Other Properties.
protected array $videoOtherProperties
Résultat array

$videoProperties protected_oe property

Array of Video Properties.
protected array $videoProperties
Résultat array

$videoTVShowProperties protected_oe property

Array of Video TV Show Properties.
protected array $videoTVShowProperties
Résultat array