本文整理匯總了PHP中phpQuery::getDocumentID方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpQuery::getDocumentID方法的具體用法?PHP phpQuery::getDocumentID怎麽用?PHP phpQuery::getDocumentID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpQuery
的用法示例。
在下文中一共展示了phpQuery::getDocumentID方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Render
/**
* @see HtmlComponent
*/
public function Render()
{
// $template =
$htmltag = $this->getTag();
$template = WebApplication::getApplication()->getTemplate(get_class($this));
$qid = \phpQuery::getDocumentID($htmltag);
$doc = \phpQuery::newDocumentHTML($template);
$htmltag->replaceWith($doc['body']->html());
//$htmltag->html($doc['body']->html());
\phpQuery::selectDocument($qid);
$this->beforeRender();
parent::RenderImpl();
$this->afterRender();
}
示例2: remove
/**
* Enter description here...
*
* @param DOMNode|phpQueryObject|string $document
* @param unknown_type $type
* @param unknown_type $callback
*
* @TODO namespace events
* @TODO support more than event in $type (space-separated)
*/
public static function remove($document, $node, $type = null, $callback = null)
{
$documentID = phpQuery::getDocumentID($document);
$eventNode = self::getNode($documentID, $node);
if (is_object($eventNode) && isset($eventNode->eventHandlers[$type])) {
if ($callback) {
foreach ($eventNode->eventHandlers[$type] as $k => $handler) {
if ($handler['callback'] == $callback) {
unset($eventNode->eventHandlers[$type][$k]);
}
}
} else {
unset($eventNode->eventHandlers[$type]);
}
}
}
示例3: __destruct
/**
* Clean up some messes
*/
function __destruct()
{
if ($this->browser->parserType == 'phpquery') {
$id = phpQuery::getDocumentID($this->parser);
phpQuery::unloadDocuments($id);
}
}