/** * @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(); }
/** * 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]); } } }
/** * Clean up some messes */ function __destruct() { if ($this->browser->parserType == 'phpquery') { $id = phpQuery::getDocumentID($this->parser); phpQuery::unloadDocuments($id); } }