[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Microdata/ -> Microdata.php (summary)

Joomla! Content Management System

Copyright: (C) 2013 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 839 lines (24 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Microdata:: (31 methods):
  __construct()
  loadTypes()
  resetParams()
  enable()
  isEnabled()
  setType()
  getType()
  property()
  getProperty()
  content()
  getContent()
  getMachineContent()
  fallback()
  getFallbackType()
  getFallbackProperty()
  display()
  displayScope()
  sanitizeType()
  sanitizeProperty()
  getTypes()
  getAvailableTypes()
  getExpectedTypes()
  getExpectedDisplayType()
  isPropertyInType()
  isTypeAvailable()
  htmlMeta()
  htmlSpan()
  htmlDiv()
  htmlTag()
  htmlScope()
  htmlProperty()


Class: Microdata  - X-Ref

Joomla Platform class for interacting with Microdata semantics.

__construct($type = '', $flag = true)   X-Ref
Initialize the class and setup the default $Type

param: string   $type  Optional, fallback to 'Thing' Type
param: boolean  $flag  Enable or disable the library output

loadTypes()   X-Ref
Load all available Types and Properties from the http://schema.org vocabulary contained in the types.json file

return: void

resetParams()   X-Ref
Reset all params

return: void

enable($flag = true)   X-Ref
Enable or Disable the library output

param: boolean  $flag  Enable or disable the library output
return: Microdata  Instance of $this

isEnabled()   X-Ref
Return 'true' if the library output is enabled

return: boolean

setType($type)   X-Ref
Set a new http://schema.org Type

param: string  $type  The $Type to be setup
return: Microdata  Instance of $this

getType()   X-Ref
Return the current $Type name

return: string

property($property)   X-Ref
Setup a $Property

param: string  $property  The Property
return: Microdata  Instance of $this

getProperty()   X-Ref
Return the current $Property name

return: string

content($content, $machineContent = null)   X-Ref
Setup a Human content or content for the Machines

param: string  $content         The human content or machine content to be used
param: string  $machineContent  The machine content
return: Microdata  Instance of $this

getContent()   X-Ref
Return the current $content

return: string

getMachineContent()   X-Ref
Return the current $machineContent

return: string

fallback($type, $property)   X-Ref
Setup a Fallback Type and Property

param: string  $type      The Fallback Type
param: string  $property  The Fallback Property
return: Microdata  Instance of $this

getFallbackType()   X-Ref
Return the current $fallbackType

return: string

getFallbackProperty()   X-Ref
Return the current $fallbackProperty

return: string

display($displayType = '', $emptyOutput = false)   X-Ref
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: string   $displayType  Optional, 'inline', available options ['inline'|'span'|'div'|meta]
param: boolean  $emptyOutput  Return an empty string if the library output is disabled and there is a $content value
return: string

displayScope()   X-Ref
Return the HTML of the current Scope

return: string

sanitizeType($type)   X-Ref
Return the sanitized $Type

param: string  $type  The Type to sanitize
return: string

sanitizeProperty($property)   X-Ref
Return the sanitized $Property

param: string  $property  The Property to sanitize
return: string

getTypes()   X-Ref
Return an array with all available Types and Properties from the http://schema.org vocabulary

return: array

getAvailableTypes()   X-Ref
Return an array with all available Types from the http://schema.org vocabulary

return: array

getExpectedTypes($type, $property)   X-Ref
Return the expected Types of the given Property

param: string  $type      The Type to process
param: string  $property  The Property to process
return: array

getExpectedDisplayType($type, $property)   X-Ref
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: string  $type      The Type where to find the Property
param: string  $property  The Property to process
return: string

isPropertyInType($type, $property)   X-Ref
Recursive function, control if the given Type has the given Property

param: string  $type      The Type where to check
param: string  $property  The Property to check
return: boolean

isTypeAvailable($type)   X-Ref
Control if the given Type class is available

param: string  $type  The Type to check
return: boolean

htmlMeta($content, $property, $scope = '', $invert = false)   X-Ref
Return Microdata semantics in a `<meta>` tag with content for machines.

param: string   $content   The machine content to display
param: string   $property  The Property
param: string   $scope     Optional, the Type scope to display
param: boolean  $invert    Optional, default = false, invert the $scope with the $property
return: string

htmlSpan($content, $property = '', $scope = '', $invert = false)   X-Ref
Return Microdata semantics in a `<span>` tag.

param: string   $content   The human content
param: string   $property  Optional, the human content to display
param: string   $scope     Optional, the Type scope to display
param: boolean  $invert    Optional, default = false, invert the $scope with the $property
return: string

htmlDiv($content, $property = '', $scope = '', $invert = false)   X-Ref
Return Microdata semantics in a `<div>` tag.

param: string   $content   The human content
param: string   $property  Optional, the human content to display
param: string   $scope     Optional, the Type scope to display
param: boolean  $invert    Optional, default = false, invert the $scope with the $property
return: string

htmlTag($tag, $content, $property = '', $scope = '', $invert = false)   X-Ref
Return Microdata semantics in a specified tag.

param: string   $tag       The HTML tag
param: string   $content   The human content
param: string   $property  Optional, the human content to display
param: string   $scope     Optional, the Type scope to display
param: boolean  $invert    Optional, default = false, invert the $scope with the $property
return: string

htmlScope($scope)   X-Ref
Return the HTML Scope

param: string  $scope  The Scope to process
return: string

htmlProperty($property)   X-Ref
Return the HTML Property

param: string  $property  The Property to process
return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer