markup() публичный Метод

Return document markup, starting with optional $nodes as root.
public markup ( $nodes = null, $innerMarkup = false ) : string
$nodes DOMNode|DOMNodeList
Результат string
Пример #1
0
 /**
  * Enter description here...
  * @TODO force html result
  *
  * @return String
  */
 public function htmlOuter($callback1 = null, $callback2 = null, $callback3 = null)
 {
     $markup = $this->documentWrapper->markup($this->elements);
     // pass thou callbacks
     $args = func_get_args();
     foreach ($args as $callback) {
         $markup = phpQuery::callbackRun($callback, array($markup));
     }
     return $markup;
 }
Пример #2
0
}
require_once '../phpQuery/DOMDocumentWrapper.php';
phpQuery::$debug = 2;
/* ENCODINGS */
//print '<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2">';
print '<meta http-equiv="Content-Type" content="text/html;charset=utf-8">';
/* HTML */
//$htmlIso = new DOMDocumentWrapper(
//	file_get_contents('document-types/document-iso88592.html')
//);
//$htmlIsoNoCharset = new DOMDocumentWrapper(
//	file_get_contents('document-types/document-iso88592-nocharset.html'),
//	'text/html;charset=iso-8859-2'
//);
$htmlUtf = new DOMDocumentWrapper(file_get_contents('document-types/document-utf8.html'));
var_dump($htmlUtf->markup());
//$htmlUtfNoCharset = new DOMDocumentWrapper(
//	file_get_contents('document-types/document-utf8-nocharset.html'),
//	'text/html;charset=utf-8'
//);
//print htmlspecialchars($htmlIso->markup(
//	$htmlIso->document->getElementsByTagName('span'))
//);
//print htmlspecialchars($htmlIsoNoCharset->markup(
//	$htmlIsoNoCharset->document->getElementsByTagName('p'))
//);
//print htmlspecialchars($htmlUtf->markup());
//print htmlspecialchars($htmlUtfNoCharset->markup());
/* XML */
//$xmlIso = new DOMDocumentWrapper(
//	file_get_contents('document-types/document-iso88592.xml')