API Documentation

Meta
in package

Helpers to fluently declare HTML meta elements using their object representations.

Table of Contents

Methods

get()  : GlobalMetadataBag
Get the global metadata bag.
link()  : LinkElement
Create a new <link> element class with the given rel and href.
name()  : MetadataElement
Create a new <meta> element class with the given name and content.
property()  : OpenGraphElement
Create a new <meta> element class with the given OpenGraph property and content.
render()  : string
Render the global metadata bag.

Methods

Create a new <link> element class with the given rel and href.

public static link(string $rel, string $href[, array<string|int, mixed> $attr = [] ]) : LinkElement
Parameters
$rel : string

The link tag's rel attribute.

$href : string

The link tag's href attribute.

$attr : array<string|int, mixed> = []

An optional key-value array of additional attributes.

Tags
link
https://www.w3schools.com/tags/tag_link.asp
Return values
LinkElement

property()

Create a new <meta> element class with the given OpenGraph property and content.

public static property(string $property, string $content) : OpenGraphElement
Parameters
$property : string

The meta tag's property attribute. The "og:" prefix is optional.

$content : string

The content of the meta tag.

Tags
link
https://ogp.me/
Return values
OpenGraphElement

render()

Render the global metadata bag.

public static render() : string
Return values
string

        
On this page

Search results