Microdata
class Microdata
Joomla Platform class for interacting with Microdata semantics.
Methods
Initialize the class and setup the default $Type
Return 'true' if the library output is enabled
Return the current $Type name
Return the current $Property name
Setup a Human content or content for the Machines
Return the current $content
Return the current $machineContent
Return the current $fallbackType
Return the current $fallbackProperty
This function handles the display logic.
Return the HTML of the current Scope
Return the sanitized $Type
Return the sanitized $Property
Return an array with all available Types and Properties from the http://schema.org vocabulary
Return an array with all available Types from the http://schema.org vocabulary
Return the expected Types of the given Property
Recursive function, control if the given Type has the given Property
Control if the given Type class is available
Return Microdata semantics in a <meta>
tag with content for machines.
Return Microdata semantics in a <span>
tag.
Return Microdata semantics in a <div>
tag.
Return Microdata semantics in a specified tag.
Return the HTML Scope
Return the HTML Property
Details
__construct(
string $type = '',
boolean $flag = true)
Initialize the class and setup the default $Type
Microdata
content(
string $content,
string $machineContent = null)
Setup a Human content or content for the Machines
string
display(
string $displayType = '',
boolean $emptyOutput = false)
This function handles the display logic.
It checks if the Type, Property are available, if not check for a Fallback, then reset all params for the next use and return the HTML.
static
array
getTypes()
Return an array with all available Types and Properties from the http://schema.org vocabulary
static
array
getAvailableTypes()
Return an array with all available Types from the http://schema.org vocabulary
static
array
getExpectedTypes(
string $type,
string $property)
Return the expected Types of the given Property
static
boolean
isPropertyInType(
string $type,
string $property)
Recursive function, control if the given Type has the given Property
static
string
htmlMeta(
string $content,
string $property,
string $scope = '',
boolean $invert = false)
Return Microdata semantics in a <meta>
tag with content for machines.
static
string
htmlSpan(
string $content,
string $property = '',
string $scope = '',
boolean $invert = false)
Return Microdata semantics in a <span>
tag.
static
string
htmlDiv(
string $content,
string $property = '',
string $scope = '',
boolean $invert = false)
Return Microdata semantics in a <div>
tag.