public function ReportEditor::deleteNode in Forena Reports 8
Same name and namespace in other branches
- 7.5 src/Editor/ReportEditor.php \Drupal\forena\Editor\ReportEditor::deleteNode()
Delete a node based on id
Parameters
string $id:
Return value
File
- src/
Editor/ ReportEditor.php, line 820 - ReportEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd
Class
Namespace
Drupal\forena\EditorCode
public function deleteNode($id) {
$path = 'body//*[@id="' . $id . '"]';
$nodes = $this->simplexml
->xpath($path);
if ($nodes) {
$node = $nodes[0];
$dom = dom_import_simplexml($node);
$dom->parentNode
->removeChild($dom);
}
return $this;
}