SchemaOrg
extends AbstractHelper
in package
View helper for injecting schema.org metadata
Tags
Table of Contents
- $enabled : bool
- $htmlAttributes : HtmlAttributes
- __construct() : mixed
- Constructor
- getAttributes() : string
- Format schema.org attributes (if enabled).
- getLink() : string
- Create a schema.org link tag (if enabled).
- getMeta() : string
- Create a schema.org meta tag (if enabled).
- getRecordTypes() : string
- Get all record types for the given record.
- getRecordTypesArray() : array<string|int, mixed>
- Get all record types for the given record.
- getTag() : string
- Get a schema.org tag (if enabled). Note that this only generates an open (or void) tag; if a close tag is required, you will need to add it yourself separately.
Properties
$enabled
protected
bool
$enabled
= true
$htmlAttributes
protected
HtmlAttributes
$htmlAttributes
Methods
__construct()
Constructor
public
__construct(HtmlAttributes $htmlAttributes[, bool $enabled = true ]) : mixed
Parameters
- $htmlAttributes : HtmlAttributes
-
HtmlAttributes view helper
- $enabled : bool = true
-
Is schema.org metadata enabled?
Return values
mixed —getAttributes()
Format schema.org attributes (if enabled).
public
getAttributes(array<string|int, mixed> $attributes) : string
Parameters
- $attributes : array<string|int, mixed>
-
HTML attributes (in key/value format)
Return values
string —getLink()
Create a schema.org link tag (if enabled).
public
getLink(string $href, string $property[, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $href : string
-
Link target
- $property : string
-
Property attribute
- $attributes : array<string|int, mixed> = []
-
Additional attributes (optional)
Return values
string —getMeta()
Create a schema.org meta tag (if enabled).
public
getMeta(string $property, string $content[, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $property : string
-
Property name
- $content : string
-
Property value
- $attributes : array<string|int, mixed> = []
-
Additional attributes (optional)
Return values
string —getRecordTypes()
Get all record types for the given record.
public
getRecordTypes(AbstractBase $driver) : string
Parameters
- $driver : AbstractBase
-
Record Driver
Return values
string —getRecordTypesArray()
Get all record types for the given record.
public
getRecordTypesArray(AbstractBase $driver) : array<string|int, mixed>
Parameters
- $driver : AbstractBase
-
Record Driver
Return values
array<string|int, mixed> —getTag()
Get a schema.org tag (if enabled). Note that this only generates an open (or void) tag; if a close tag is required, you will need to add it yourself separately.
public
getTag(string $tag, array<string|int, mixed> $attributes) : string
Parameters
- $tag : string
-
Tag name
- $attributes : array<string|int, mixed>
-
Tag attributes