Engine¶
Qualified name: | Ouxsoft\LivingMarkup\Engine |
---|---|
Implements: | EngineInterface |
-
class
Engine
¶ -
public
__construct
(DocumentInterface` $document, ElementPoolInterface` $element_pool)¶ Engine
constructor.Parameters: - $document (DocumentInterface`) –
- $element_pool (ElementPoolInterface`) –
-
public
__toString
() → string¶ Returns DomDocument property as HTML5
Returns: string –
-
public
callRoutine
(array $routine)¶ Call Hooks
Parameters: - $routine (array) –
Returns: bool-
-
public
getDomElementByPlaceholderId
(string $element_id)¶ Gets DOMElement using element_id provided
Parameters: - $element_id (string) –
Returns: DOMElement|null
-
public
getElementAncestorProperties
(string $element_id) → array¶ Get a Element ancestors’ properties based on provided element_id DOMElement’s ancestors
Parameters: - $element_id (string) –
Returns: array –
-
public
getElementArgs
(DOMElement $element) → ArgumentArray¶ Get DOMElement’s attribute and child <args> elements and return as a single list items within the list are called args as they are passed as parameters to element methods
Parameters: - $element (DOMElement) –
Returns:
-
public
getElementInnerXML
(string $element_id) → string¶ Get Element inner XML
Parameters: - $element_id (string) –
Returns: string –
-
public
instantiateElements
(array $lhtml_element) → bool¶ Instantiates elements from DOMElement’s found during Xpath query against DOM property
Parameters: - $lhtml_element (array) –
Returns: bool –
-
public
queryFetch
(string $query[, DOMElement $node]) → mixed¶ XPath query for class $this->DOM property that fetches only first result
Parameters: - $query (string) –
- $node (DOMElement) – Default:
null
Returns: mixed –
-
public
queryFetchAll
(string $query[, DOMElement $node]) → mixed¶ XPath query for class $this->DOM property that fetches all results as array
Parameters: - $query (string) –
- $node (DOMElement) – Default:
null
Returns: mixed –
-
public
removeElements
(array $lhtml_element)¶ Removes elements from the DOM
Parameters: - $lhtml_element (array) –
Returns: void
-
public
renderElement
(string $element_id) → bool¶ Within DOMDocument replace DOMElement with Element->:class:__toString() output
Parameters: - $element_id (string) –
Returns: bool –
-
public
replaceDomElement
(DOMElement $element, string $new_xml)¶ Replaces DOMElement from property DOM with contents provided
Parameters: - $element (DOMElement) –
- $new_xml (string) –
-
public
setType
([])¶ Set a value type to avoid Type Juggling issues and extend data types
Parameters: - $value – Default:
null
- $type – Default:
'string'
Returns: bool|mixed|string|null
- $value – Default:
-
private
instantiateElement
(DOMElement $element, string $class_name) → bool¶ Instantiate a DOMElement as a Element using specified class_name
Parameters: - $element (DOMElement) –
- $class_name (string) –
Returns: bool –
-
public