本文整理匯總了PHP中DOMText::removeChild方法的典型用法代碼示例。如果您正苦於以下問題:PHP DOMText::removeChild方法的具體用法?PHP DOMText::removeChild怎麽用?PHP DOMText::removeChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DOMText
的用法示例。
在下文中一共展示了DOMText::removeChild方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
/**
* Remove a child frame
*
* @param Frame $child
* @param boolean $update_node Whether or not to remove the DOM node
*
* @throws DOMPDF_Exception
* @return Frame The removed child frame
*/
function remove_child(Frame $child, $update_node = true)
{
if ($child->_parent !== $this) {
throw new DOMPDF_Exception("Child not found in this frame");
}
if ($update_node) {
$this->_node->removeChild($child->_node);
}
if ($child === $this->_first_child) {
$this->_first_child = $child->_next_sibling;
}
if ($child === $this->_last_child) {
$this->_last_child = $child->_prev_sibling;
}
if ($child->_prev_sibling) {
$child->_prev_sibling->_next_sibling = $child->_next_sibling;
}
if ($child->_next_sibling) {
$child->_next_sibling->_prev_sibling = $child->_prev_sibling;
}
$child->_next_sibling = null;
$child->_prev_sibling = null;
$child->_parent = null;
return $child;
}