Skip to content

Commit

Permalink
Merge pull request #8 from Ouxsoft/v4.2.0
Browse files Browse the repository at this point in the history
V4.2.0
  • Loading branch information
hxtree authored Jul 9, 2021
2 parents 2241410 + 06332af commit a8c2f9d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
45 changes: 36 additions & 9 deletions src/Element/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,49 @@
*/
abstract class AbstractElement
{
// id used to reference object
/**
* @var int|string the id used to reference object
*/
public $element_id = 0;
// id used to load args

/**
* @var int id used to load args
*/
public $id = 0;
// name of element

/**
* @var string the name of element
*/
public $name = 'unknown';
// args passed to during construction

/**
* @var array|ArgumentArray|null args passed to during construction
*/
public $args = [];
// tags used for filtering

/**
* @var array tags used for filtering
*/
public $tags = [];
// render in search result builder

/**
* @var bool render in search result builder
*/
public $search_index = true;
// maximum results of data pulled

/**
* @var string maximum results of data pulled
*/
public $max_results = '240';
// ancestor public variable updated live

/**
* @var array ancestor public variable updated live
*/
public $ancestors = [];
// inner content updated live

/**
* @var string inner content updated live
*/
public $xml = '';

/**
Expand Down Expand Up @@ -112,6 +138,7 @@ public function getArgs(): ArgumentArray

/**
* Get innerText
*
* @return string|null
*/
public function innerText(): ?string
Expand Down
6 changes: 5 additions & 1 deletion src/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ public function getElementArgs(DOMElement $element): ArgumentArray
}

// get value
$value = $child_node->nodeValue;
$innerHTML = '';
foreach ($child_node->childNodes as $child) {
$innerHTML .= $element->ownerDocument->saveXML($child);
}
$value = $innerHTML;

// get type
$type = $child_node->getAttribute('type') ?? 'string';
Expand Down

0 comments on commit a8c2f9d

Please sign in to comment.