|
static | sanitizeType ($type) |
|
static | sanitizeProperty ($property) |
|
static | getTypes () |
|
static | getAvailableTypes () |
|
static | getExpectedTypes ($type, $property) |
|
static | isPropertyInType ($type, $property) |
|
static | isTypeAvailable ($type) |
|
static | htmlMeta ($content, $property, $scope='', $invert=false) |
|
static | htmlSpan ($content, $property='', $scope='', $invert=false) |
|
static | htmlDiv ($content, $property='', $scope='', $invert=false) |
|
static | htmlTag ($tag, $content, $property='', $scope='', $invert=false) |
|
static | htmlScope ($scope) |
|
static | htmlProperty ($property) |
|
Joomla Platform class for interacting with Microdata semantics.
- Depuis
- 3.2
◆ __construct()
__construct |
( |
|
$type = '' , |
|
|
|
$flag = true |
|
) |
| |
Initialize the class and setup the default $Type
- Paramètres
-
string | $type | Optional, fallback to 'Thing' Type |
boolean | $flag | Enable or disable the library output |
- Depuis
- 3.2
Références $type.
◆ content()
content |
( |
|
$content, |
|
|
|
$machineContent = null |
|
) |
| |
Setup a Human content or content for the Machines
- Paramètres
-
string | $content | The human content or machine content to be used |
string | $machineContent | The machine content |
- Renvoie
- Microdata Instance of $this
- Depuis
- 3.2
Références $content, $this, et content.
◆ display()
display |
( |
|
$displayType = '' , |
|
|
|
$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.
- Paramètres
-
string | $displayType | Optional, 'inline', available options ['inline'|'span'|'div'|meta] |
boolean | $emptyOutput | Return an empty string if the library output is disabled and there is a $content value |
- Renvoie
- string
- Depuis
- 3.2
Références $content, $html, content, elseif, et null.
◆ displayScope()
Return the HTML of the current Scope
- Renvoie
- string
- Depuis
- 3.2
◆ enable()
Enable or Disable the library output
- Paramètres
-
boolean | $flag | Enable or disable the library output |
- Renvoie
- Microdata Instance of $this
- Depuis
- 3.2
Références $this.
◆ fallback()
fallback |
( |
|
$type, |
|
|
|
$property |
|
) |
| |
Setup a Fallback Type and Property
- Paramètres
-
string | $type | The Fallback Type |
string | $property | The Fallback Property |
- Renvoie
- Microdata Instance of $this
- Depuis
- 3.2
Références $this, $type, et null.
◆ getAvailableTypes()
static getAvailableTypes |
( |
| ) |
|
|
static |
Return an array with all available Types from the http://schema.org vocabulary
- Renvoie
- array
- Depuis
- 3.2
◆ getContent()
Return the current $content
- Renvoie
- string
- Depuis
- 3.2
Références $content.
◆ getExpectedDisplayType()
static getExpectedDisplayType |
( |
|
$type, |
|
|
|
$property |
|
) |
| |
|
staticprotected |
Return the expected display type: [normal|nested|meta] In which way to display the Property: normal -> itemprop="name" nested -> itemprop="director" itemscope itemtype="https://schema.org/Person" meta -> <meta itemprop="datePublished" content="1991-05-01">
- Paramètres
-
string | $type | The Type where to find the Property |
string | $property | The Property to process |
- Renvoie
- string
- Depuis
- 3.2
Références $type.
◆ getExpectedTypes()
static getExpectedTypes |
( |
|
$type, |
|
|
|
$property |
|
) |
| |
|
static |
Return the expected Types of the given Property
- Paramètres
-
string | $type | The Type to process |
string | $property | The Property to process |
- Renvoie
- array
- Depuis
- 3.2
Références $tmp, et $type.
◆ getFallbackProperty()
Return the current $fallbackProperty
- Renvoie
- string
- Depuis
- 3.2
◆ getFallbackType()
Return the current $fallbackType
- Renvoie
- string
- Depuis
- 3.2
◆ getMachineContent()
Return the current $machineContent
- Renvoie
- string
- Depuis
- 3.3
◆ getProperty()
Return the current $Property name
- Renvoie
- string
- Depuis
- 3.2
◆ getType()
Return the current $Type name
- Renvoie
- string
- Depuis
- 3.2
Références $type.
◆ getTypes()
Return an array with all available Types and Properties from the http://schema.org vocabulary
- Renvoie
- array
- Depuis
- 3.2
◆ htmlDiv()
static htmlDiv |
( |
|
$content, |
|
|
|
$property = '' , |
|
|
|
$scope = '' , |
|
|
|
$invert = false |
|
) |
| |
|
static |
Return Microdata semantics in a <div>
tag.
- Paramètres
-
string | $content | The human content |
string | $property | Optional, the human content to display |
string | $scope | Optional, the Type scope to display |
boolean | $invert | Optional, default = false, invert the $scope with the $property |
- Renvoie
- string
- Depuis
- 3.2
Références $content, et $scope.
◆ htmlMeta()
static htmlMeta |
( |
|
$content, |
|
|
|
$property, |
|
|
|
$scope = '' , |
|
|
|
$invert = false |
|
) |
| |
|
static |
Return Microdata semantics in a <meta>
tag with content for machines.
- Paramètres
-
string | $content | The machine content to display |
string | $property | The Property |
string | $scope | Optional, the Type scope to display |
boolean | $invert | Optional, default = false, invert the $scope with the $property |
- Renvoie
- string
- Depuis
- 3.2
Références $content, et $scope.
◆ htmlProperty()
static htmlProperty |
( |
|
$property | ) |
|
|
static |
Return the HTML Property
- Paramètres
-
string | $property | The Property to process |
- Renvoie
- string
- Depuis
- 3.2
◆ htmlScope()
static htmlScope |
( |
|
$scope | ) |
|
|
static |
Return the HTML Scope
- Paramètres
-
string | $scope | The Scope to process |
- Renvoie
- string
- Depuis
- 3.2
Références $scope.
◆ htmlSpan()
static htmlSpan |
( |
|
$content, |
|
|
|
$property = '' , |
|
|
|
$scope = '' , |
|
|
|
$invert = false |
|
) |
| |
|
static |
Return Microdata semantics in a <span>
tag.
- Paramètres
-
string | $content | The human content |
string | $property | Optional, the human content to display |
string | $scope | Optional, the Type scope to display |
boolean | $invert | Optional, default = false, invert the $scope with the $property |
- Renvoie
- string
- Depuis
- 3.2
Références $content, et $scope.
◆ htmlTag()
static htmlTag |
( |
|
$tag, |
|
|
|
$content, |
|
|
|
$property = '' , |
|
|
|
$scope = '' , |
|
|
|
$invert = false |
|
) |
| |
|
static |
Return Microdata semantics in a specified tag.
- Paramètres
-
string | $tag | The HTML tag |
string | $content | The human content |
string | $property | Optional, the human content to display |
string | $scope | Optional, the Type scope to display |
boolean | $invert | Optional, default = false, invert the $scope with the $property |
- Renvoie
- string
- Depuis
- 3.3
Références $content, $scope, et $tmp.
◆ isEnabled()
Return 'true' if the library output is enabled
- Renvoie
- boolean
- Depuis
- 3.2
Références $enabled.
◆ isPropertyInType()
static isPropertyInType |
( |
|
$type, |
|
|
|
$property |
|
) |
| |
|
static |
Recursive function, control if the given Type has the given Property
- Paramètres
-
string | $type | The Type where to check |
string | $property | The Property to check |
- Renvoie
- boolean
- Depuis
- 3.2
Références $type.
◆ isTypeAvailable()
static isTypeAvailable |
( |
|
$type | ) |
|
|
static |
Control if the given Type class is available
- Paramètres
-
string | $type | The Type to check |
- Renvoie
- boolean
- Depuis
- 3.2
Références $type.
◆ loadTypes()
Load all available Types and Properties from the http://schema.org vocabulary contained in the types.json file
- Renvoie
- void
- Depuis
- 3.2
Références $path, et __DIR__.
◆ property()
Setup a $Property
- Paramètres
-
string | $property | The Property |
- Renvoie
- Microdata Instance of $this
- Depuis
- 3.2
Références $this.
◆ resetParams()
Reset all params
- Renvoie
- void
- Depuis
- 3.2
Références content, et null.
◆ sanitizeProperty()
static sanitizeProperty |
( |
|
$property | ) |
|
|
static |
Return the sanitized $Property
- Paramètres
-
string | $property | The Property to sanitize |
- Renvoie
- string
- Depuis
- 3.2
◆ sanitizeType()
static sanitizeType |
( |
|
$type | ) |
|
|
static |
Return the sanitized $Type
- Paramètres
-
string | $type | The Type to sanitize |
- Renvoie
- string
- Depuis
- 3.2
Références $type.
◆ setType()
◆ $content
◆ $enabled
◆ $fallbackProperty
◆ $fallbackType
◆ $machineContent
◆ $property
◆ $type
◆ $types
La documentation de cette classe a été générée à partir du fichier suivant :