PageMeta extends HtmlMeta
Generates meta tags for the <head> section of a web page.
Tags
Table of Contents
- $articleFeed : string
- $canonicalUrl : string
- $description : string
- $facebookMeta : FacebookMeta|null
- $keywords : array<string|int, mixed>
- $podcastFeed : string
- $robots : string
- $twitterMeta : TwitterMeta|null
- $withKeywords : bool
- __construct() : mixed
- __toString() : string
- addKeyword() : self
- Add a keyword.
- createFromCorePost() : PageMeta
- getArticleFeed() : string
- getCanonicalUrl() : string
- getDescription() : string
- getFacebookMeta() : FacebookMeta|null
- getKeywords() : array<string|int, string>
- Returns a list of strings (keywords).
- getPodcastFeed() : string
- getRobots() : string
- getTwitterMeta() : TwitterMeta|null
- getWithKeywords() : bool
- Returns true if keywords meta tag is to be added.
- render() : string
- Render the component to HTML.
- setArticleFeed() : self
- setCanonicalUrl() : self
- setDescription() : self
- setFacebookMeta() : self
- setKeywords() : self
- Add a list keywords. $keywords may also be set as a single string or tokenized (e.g. CSV, piped).
- setPodcastFeed() : self
- setRobots() : self
- setTwitterMeta() : self
- setWithKeywords() : self
- Adds keywords meta tag if $withKeywords is true.
Properties
$articleFeed
private
string
$articleFeed
= ''
$canonicalUrl
private
string
$canonicalUrl
= ''
$description
private
string
$description
= ''
$facebookMeta
private
FacebookMeta|null
$facebookMeta
= null
$keywords
private
array<string|int, mixed>
$keywords
= []
$podcastFeed
private
string
$podcastFeed
= ''
$robots
private
string
$robots
= ''
$twitterMeta
private
TwitterMeta|null
$twitterMeta
= null
$withKeywords
private
bool
$withKeywords
= false
Methods
__construct()
public
__construct([FacebookMeta|null $facebookMeta = null ][, TwitterMeta|null $twitterMeta = null ]) : mixed
Parameters
- $facebookMeta : FacebookMeta|null = null
- $twitterMeta : TwitterMeta|null = null
Return values
mixed —__toString()
public
__toString() : string
Return values
string —addKeyword()
Add a keyword.
public
addKeyword(mixed $keyword) : self
Parameters
- $keyword : mixed
Return values
self —createFromCorePost()
public
static createFromCorePost(CorePost $post) : PageMeta
Parameters
- $post : CorePost
Return values
PageMeta —getArticleFeed()
public
getArticleFeed() : string
Return values
string —getCanonicalUrl()
public
getCanonicalUrl() : string
Return values
string —getDescription()
public
getDescription() : string
Return values
string —getFacebookMeta()
public
getFacebookMeta() : FacebookMeta|null
Return values
FacebookMeta|null —getKeywords()
Returns a list of strings (keywords).
public
getKeywords() : array<string|int, string>
Return values
array<string|int, string> —getPodcastFeed()
public
getPodcastFeed() : string
Return values
string —getRobots()
public
getRobots() : string
Return values
string —getTwitterMeta()
public
getTwitterMeta() : TwitterMeta|null
Return values
TwitterMeta|null —getWithKeywords()
Returns true if keywords meta tag is to be added.
public
getWithKeywords() : bool
Return values
bool —render()
Render the component to HTML.
public
render() : string
Return values
string —setArticleFeed()
public
setArticleFeed(mixed $articleFeed) : self
Parameters
- $articleFeed : mixed
Return values
self —setCanonicalUrl()
public
setCanonicalUrl(mixed $canonicalUrl) : self
Parameters
- $canonicalUrl : mixed
Return values
self —setDescription()
public
setDescription(mixed $description) : self
Parameters
- $description : mixed
Return values
self —setFacebookMeta()
public
setFacebookMeta(FacebookMeta $facebookMeta) : self
Parameters
- $facebookMeta : FacebookMeta
Return values
self —setKeywords()
Add a list keywords. $keywords may also be set as a single string or tokenized (e.g. CSV, piped).
public
setKeywords(array<string|int, mixed>|string $keywords[, string $token = '' ]) : self
Parameters
- $keywords : array<string|int, mixed>|string
- $token : string = ''
-
Optional
Return values
self —setPodcastFeed()
public
setPodcastFeed(mixed $podcastFeed) : self
Parameters
- $podcastFeed : mixed
Return values
self —setRobots()
public
setRobots(mixed $robots) : self
Parameters
- $robots : mixed
Return values
self —setTwitterMeta()
public
setTwitterMeta(TwitterMeta $twitterMeta) : self
Parameters
- $twitterMeta : TwitterMeta
Return values
self —setWithKeywords()
Adds keywords meta tag if $withKeywords is true.
public
setWithKeywords(bool $withKeywords) : self
Parameters
- $withKeywords : bool