本文整理汇总了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);
}
}