Microdata

Joomla 平台类,用于与 Microdata 语义交互。

3.2

Joomla CMS

方法

__construct

初始化类并设置默认 $Type

__construct( type = '',  flag = true) : 

3.2

参数

type

string可选,回退到 'Thing' 类型

flag

bool启用或禁用库输出

响应

混合

content

设置人类内容或机器内容

content( content,  machineContent = null) : \Joomla\CMS\Microdata\Microdata

3.2

参数

content

string要使用的人类内容或机器内容

machineContent

string机器内容

响应

Microdata$this 的实例

display

此函数处理显示逻辑。

display( displayType = '',  emptyOutput = false) : 

它检查类型和属性是否可用,如果不可用,则检查回退,然后重置所有参数以供下次使用并返回 HTML。

3.2

参数

displayType

string可选,'inline',可用选项 ['inline'|'span'|'div'|meta]

emptyOutput

bool如果库输出已禁用且存在 $content 值,则返回空字符串

响应

string

displayScope

返回当前范围的 HTML

displayScope() : 

3.2

响应

string

enable

启用或禁用库输出

enable( flag = true) : \Joomla\CMS\Microdata\Microdata

3.2

参数

flag

bool启用或禁用库输出

响应

Microdata$this 的实例

fallback

设置回退类型和属性

fallback( type,  property) : \Joomla\CMS\Microdata\Microdata

3.2

参数

type

string回退类型

property

string回退属性

响应

Microdata$this 的实例

getAvailableTypes

返回来自 http://schema.org 词汇表的所有可用类型的数组

getAvailableTypes() : mixed||string|int
静态

3.2

响应

array<string|int, mixed>

getContent

返回当前 $content

getContent() : 

3.2

响应

string

getExpectedTypes

返回给定属性的预期类型

getExpectedTypes( type,  property) : mixed||string|int
静态

3.2

参数

type

string要处理的类型

property

string要处理的属性

响应

array<string|int, mixed>

getFallbackProperty

返回当前 $fallbackProperty

getFallbackProperty() : 

3.2

响应

string

getFallbackType

返回当前 $fallbackType

getFallbackType() : 

3.2

响应

string

getMachineContent

返回当前 $machineContent

getMachineContent() : 

3.3

响应

string

getProperty

返回当前 $Property 名称

getProperty() : 

3.2

响应

string

getType

返回当前 $Type 名称

getType() : 

3.2

响应

string

getTypes

返回来自 http://schema.org 词汇表的所有可用类型和属性的数组

getTypes() : mixed||string|int
静态

3.2

响应

array<string|int, mixed>

htmlDiv

<div> 标签中返回 Microdata 语义。

htmlDiv( content,  property = '',  scope = '',  invert = false) : 
静态

3.2

参数

content

string人类内容

property

string可选,要显示的人类内容

scope

string可选,要显示的类型范围

invert

bool可选,默认 = false,将 $scope 与 $property 反转

响应

string

htmlMeta

在带有机器内容的 <meta> 标签中返回 Microdata 语义。

htmlMeta( content,  property,  scope = '',  invert = false) : 
静态

3.2

参数

content

string要显示的机器内容

property

string属性

scope

string可选,要显示的类型范围

invert

bool可选,默认 = false,将 $scope 与 $property 反转

响应

string

htmlProperty

返回 HTML 属性

htmlProperty( property) : 
静态

3.2

参数

property

string要处理的属性

响应

string

htmlScope

返回 HTML 范围

htmlScope( scope) : 
静态

3.2

参数

scope

string要处理的范围

响应

string

htmlSpan

<span> 标签中返回 Microdata 语义。

htmlSpan( content,  property = '',  scope = '',  invert = false) : 
静态

3.2

参数

content

string人类内容

property

string可选,要显示的人类内容

scope

string可选,要显示的类型范围

invert

bool可选,默认 = false,将 $scope 与 $property 反转

响应

string

htmlTag

在指定标签中返回 Microdata 语义。

htmlTag( tag,  content,  property = '',  scope = '',  invert = false) : 
静态

3.3

参数

tag

stringHTML 标签

content

string人类内容

property

string可选,要显示的人类内容

scope

string可选,要显示的类型范围

invert

bool可选,默认 = false,将 $scope 与 $property 反转

响应

string

isEnabled

如果库输出已启用,则返回 'true'

isEnabled() : 

3.2

响应

bool

isPropertyInType

递归函数,控制给定类型是否具有给定属性

isPropertyInType( type,  property) : 
静态

3.2

参数

type

string要检查的类型

property

string要检查的属性

响应

bool

isTypeAvailable

控制给定类型类是否可用

isTypeAvailable( type) : 
静态

3.2

参数

type

string要检查的类型

响应

bool

property

设置 $Property

property( property) : \Joomla\CMS\Microdata\Microdata

3.2

参数

property

string属性

响应

Microdata$this 的实例

sanitizeProperty

返回已清理的 $Property

sanitizeProperty( property) : 
静态

3.2

参数

property

string要清理的属性

响应

string

sanitizeType

返回已清理的 $Type

sanitizeType( type) : 
静态

3.2

参数

type

string要清理的类型

响应

string

setType

设置新的 http://schema.org 类型

setType( type) : \Joomla\CMS\Microdata\Microdata

3.2

参数

type

string要设置的 $Type

响应

Microdata$this 的实例

属性