TwitterMeta extends HtmlMeta
Represents Twitter meta tag data.
Table of Contents
- $card : string
- $doNotTrack : bool
- $imageUrl : string
- $labels : array<string|int, mixed>
- $site : string
- $title : string
- __construct() : mixed
- __toString() : string
- addLabels() : self
- Adds data for Twitter "label[n=1]" data where "label" is the dictionary key and "data" is the dictionary value.
- createFromCorePost() : TwitterMeta
- getCard() : string
- getDoNotTrack() : bool
- getImageUrl() : string
- getLabels() : array<string, string>
- getSite() : string
- Get the value of the Twitter handle.
- getTitle() : string
- render() : string
- Render the component to HTML.
- setCard() : self
- setDoNotTrack() : self
- setImageUrl() : self
- setSite() : self
- Set the Twitter handle.
- setTitle() : self
Properties
$card
private
string
$card
= 'summary'
$doNotTrack
private
bool
$doNotTrack
= false
$imageUrl
private
string
$imageUrl
= ''
$labels
private
array<string|int, mixed>
$labels
= []
$site
private
string
$site
= ''
$title
private
string
$title
= ''
Methods
__construct()
public
__construct() : mixed
Return values
mixed —__toString()
public
__toString() : string
Return values
string —addLabels()
Adds data for Twitter "label[n=1]" data where "label" is the dictionary key and "data" is the dictionary value.
public
addLabels(array<string, string> $labels) : self
Parameters
- $labels : array<string, string>
Return values
self —createFromCorePost()
public
static createFromCorePost(CorePost $post) : TwitterMeta
Parameters
- $post : CorePost
Return values
TwitterMeta —getCard()
public
getCard() : string
Return values
string —getDoNotTrack()
public
getDoNotTrack() : bool
Return values
bool —getImageUrl()
public
getImageUrl() : string
Return values
string —getLabels()
public
getLabels() : array<string, string>
Return values
array<string, string> —getSite()
Get the value of the Twitter handle.
public
getSite() : string
Return values
string —getTitle()
public
getTitle() : string
Return values
string —render()
Render the component to HTML.
public
render() : string
Return values
string —setCard()
public
setCard(string $card) : self
Parameters
- $card : string
Return values
self —setDoNotTrack()
public
setDoNotTrack(bool $doNotTrack) : self
Parameters
- $doNotTrack : bool
Return values
self —setImageUrl()
public
setImageUrl(string $imageUrl) : self
Parameters
- $imageUrl : string
Return values
self —setSite()
Set the Twitter handle.
public
setSite(string $site) : self
Parameters
- $site : string
Return values
self —setTitle()
public
setTitle(string $title) : self
Parameters
- $title : string