\JMicrodata
Joomla Platform class for interacting with Microdata semantics.
Synopsis
class JMicrodata
{
- // members
- protected $types;
- protected $type;
- protected $property;
- protected $content;
- protected $machineContent;
- protected $fallbackType;
- protected $fallbackProperty;
- protected $fallback;
- protected $enabled;
- // methods
- public void __construct()
- protected static void loadTypes()
- public JMicrodata enable()
- public boolean isEnabled()
- public JMicrodata setType()
- public string getType()
- public JMicrodata property()
- public string getProperty()
- public JMicrodata content()
- public string getContent()
- public JMicrodata fallback()
- public string getFallbackType()
- public string getFallbackProperty()
- public string display()
- public string displayScope()
- public static string sanitizeType()
- public static string sanitizeProperty()
- public static array getTypes()
- public static array getAvailableTypes()
- public static array getExpectedTypes()
- protected static string getExpectedDisplayType()
- public static boolean isPropertyInType()
- public static boolean isTypeAvailable()
- public static string htmlMeta()
- public static string htmlSpan()
- public static string htmlDiv()
- public static string htmlScope()
- public static string htmlProperty()
Members
protected
- $content
—
string
The Human value or Machine value - $enabled
—
boolean
Used to check if the Microdata semantics output are enabled or disabled - $fallback
—
string
Used to check if a Fallback must be used - $fallbackProperty
—
string
Fallback Property - $fallbackType
—
string
Fallback Type - $machineContent
—
string
The Machine value - $property
—
string
The Property - $type
—
string
The Schema.org Type - $types
—
array
Array with all available Types and Properties
Methods
protected
- getExpectedDisplayType() — Return the expected display type of the [normal|nested|meta] In wich way to display the Property: normal -> itemprop="name" nested -> itemprop="director" itemscope itemtype="http://schema.org/Person" meta -> <meta itemprop="datePublished" content="1991-05-01">
- loadTypes() — Load all Types and Properties from the types.json file
public
- __construct() — Initialize the class and setup the default Type
- content() — Setup a Text value or Content value for the Microdata
- display() — This function handle the logic of a Microdata intelligent display.
- displayScope() — Return the HTML of the current Scope
- enable() — Enable or Disable Microdata semantics output
- fallback() — Setup a Fallback Type and Property
- getAvailableTypes() — Return an array with all available Types
- getContent() — Return the content variable
- getExpectedTypes() — Return the expected types of the Property
- getFallbackProperty() — Return the fallbackProperty variable
- getFallbackType() — Return the fallbackType variable
- getProperty() — Return the property variable
- getType() — Return the current Type name
- getTypes() — Return an array with all Types and Properties
- htmlDiv() — Return the microdata in an <div> tag.
- htmlMeta() — Return the microdata in a <meta> tag with the machine content inside.
- htmlProperty() — Return the HTML Property
- htmlScope() — Return the HTML Scope
- htmlSpan() — Return the microdata in an <span> tag.
- isEnabled() — Return true if Microdata semantics output are enabled
- isPropertyInType() — Recursive function, control if the given Type has the given Property
- isTypeAvailable() — Control if the given Type class is available
- property() — Setup a Property
- sanitizeProperty() — Return the sanitized Property
- sanitizeType() — Return the sanitized Type
- setType() — Set a new Schema.org Type