\Jkphl\Micrometa\ParserMicroformats2

Extended Microformats2 parser

Summary

Methods
Properties
Constants
__construct()
parse()
No public properties found
No constants found
_refineResults()
$_url
N/A
No private methods found
No private properties found
N/A

Properties

Methods

__construct()

__construct(\DOMDocument|string $input, \Jkphl\Utility\Url|\string $url)

Constructor

Parameters

\DOMDocument|string $input

The data to parse. A string of HTML or a DOMDocument

\Jkphl\Utility\Url|\string $url

Optional: The URL of the parsed document, for relative URL resolution

parse()

parse(bool $convertClassic, \Jkphl\Micrometa\Parser\DOMElement $context) : array

Kicks off the parsing routine

If $convertClassic is set, any angle brackets in the results from non e-* properties will be HTML-encoded, bringing all output to the same level of encoding.

If a DOMElement is set as the $context, only descendants of that element will be parsed for microformats.

Parameters

bool $convertClassic

Whether or not to html-encode non e-* properties. Defaults to false

\Jkphl\Micrometa\Parser\DOMElement $context

Optionall: An element from which to parse microformats

Returns

array —

An array containing all the µfs found in the current document

_refineResults()

_refineResults(\array $results) : \array

Refine micro information items

Parameters

\array $results

Micro information items

Returns

\array —

Refined micro information items