create() public static method

Create new document.
public static create ( string $string = null, boolean $isFile = false, string $encoding = 'UTF-8', string $type = 'html' ) : Document
$string string HTML or XML string or file path
$isFile boolean Indicates that in first parameter was passed to the file path
$encoding string The document encoding
$type string The document type
return Document
コード例 #1
0
ファイル: Element.php プロジェクト: imangazaliev/didom
 /**
  * Create new element node by CSS selector.
  *
  * @param string $selector
  * @param string $value
  * @param array $attributes
  *
  * @return \DiDom\Element
  */
 public static function createBySelector($selector, $value = null, $attributes = [])
 {
     return Document::create()->createElementBySelector($selector, $value, $attributes);
 }
コード例 #2
0
ファイル: DocumentTest.php プロジェクト: imangazaliev/didom
 public function testCreate()
 {
     $this->assertInstanceOf(Document::class, Document::create());
 }