Pop\Dom\Dom::__construct PHP Method

__construct() public method

Instantiate the document object
public __construct ( string $doctype = null, string $charset = 'utf-8', mixed $childNode = null, string $indent = null ) : Dom
$doctype string
$charset string
$childNode mixed
$indent string
return Dom
    public function __construct($doctype = null, $charset = 'utf-8', $childNode = null, $indent = null)
    {
        $this->setDoctype($doctype);
        $this->charset = $charset;
        $this->indent = $indent;
        if (null !== $childNode) {
            $this->addChild($childNode);
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Constructor
  *
  * Instantiate the feed object.
  *
  * @param  array  $headers
  * @param  array  $items
  * @param  mixed  $type
  * @param  string $date
  * @return \Pop\Feed\Writer
  */
 public function __construct($headers, $items, $type = Writer::RSS, $date = 'D, j M Y H:i:s O')
 {
     $this->headers = $headers;
     $this->items = $items;
     $this->feedType = $type;
     $this->dateFormat = $date;
     parent::__construct($this->feedType, 'utf-8');
     $this->init();
 }
All Usage Examples Of Pop\Dom\Dom::__construct