コード例 #1
0
ファイル: Element.php プロジェクト: mast3rpee/blw
 /**
  * Retrieves the HTML of element and its children.
  *
  * @return string Raw HTML. Returns <code>FALSE</code> on error.
  */
 public function getOuterHTML()
 {
     // Does document exist?
     if ($this->ownerDocument instanceof DOMDocument) {
         // @codeCoverageIgnoreStart
         // PHP >= 5.3.6
         if (version_compare(PHP_VERSION, '5.3.6', '>=')) {
             // Add HTML
             $outerHTML = $this->ownerDocument->saveHTML($this);
             // PHP <= 5.3.6
         } else {
             // Create new Document
             $Document = new Document();
             // Attach child
             $Document->appendChild($Document->importNode($this, true));
             // Save HTML
             $outerHTML = $Document->saveHTML();
         }
         // @codeCoverageIgnoreEnd
         // Done
         return $outerHTML;
     }
     // Error
     return false;
 }
コード例 #2
0
ファイル: DocumentTest.php プロジェクト: mast3rpee/blw
 /**
  * @covers ::getID
  */
 public function test_getID()
 {
     $this->assertNotEmpty($this->Document->getID(), 'IDocument::getID() Returned an invalid value');
     $this->assertInternalType('string', $this->Document->getID(), 'IDocument::getID() returned an invalid value');
 }
コード例 #3
0
ファイル: ABrowser.php プロジェクト: mast3rpee/blw
 /**
  * Creates a default page for exceptional errors / responses.
  *
  * @param \BLW\Type\HTTP\IRequest $Request
  *            [optional] Request that produced timeout.
  * @return \BLW\Type\HTTP\Browser\IPage Generated Page.
  */
 public function createUnknownPage(IRequest $Request = null)
 {
     $Request = $Request ?: new Request();
     // Create Document
     $Document = new Document();
     $HTML = "<html>\r\n<head><title>Untitled</title></head>\r\n<body bgcolor=\"white\"></body>\r\n</html>\r\n";
     $Document->loadHTML($HTML);
     // Create Page
     $Base = $Request->URI ?: new GenericURI('about:none');
     $Page = new HTMLPage($Document, $Base, $Request->Header, new RFC2616Head(), $this->_Mediator);
     // Done
     return $Page;
 }