RulesInterface
interface RulesInterface
To create a new rule set for writing output the RulesInterface needs to be implemented.
The resulting class can be specified in the options with the key of rules.
For an example implementation see \Masterminds\Html5\Serializer\OutputRules.
Methods
The class constructor.
Write an element.
Write a text node.
Write a CDATA node.
Write a comment node.
Write a processor instruction.
Details
at line line 29
__construct(
mixed $output,
array $options = array())
The class constructor.
Note, before the rules can be used a traverser must be registered.
at line line 40
RulesInterface
setTraverser(
Traverser $traverser)
Register the traverser used in but the rules.
Note, only one traverser can be used by the rules.
at line line 50
document(
DOMDocument $dom)
Write a document element (\DOMDocument).
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.
at line line 60
element(
mixed $ele)
Write an element.
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.
at line line 70
text(
mixed $ele)
Write a text node.
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.
at line line 80
cdata(
mixed $ele)
Write a CDATA node.
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.
at line line 90
comment(
mixed $ele)
Write a comment node.
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.
at line line 102
processorInstruction(
mixed $ele)
Write a processor instruction.
To learn about processor instructions see \Masterminds\Html5\InstructionProcessor
Instead of returning the result write it to the output stream ($output) that was passed into the constructor.