__construct() public méthode

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
Résultat Dom
 /**
  * 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();
 }
Exemple #2
0
 /**
  * Constructor
  *
  * Instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @param  array  $fields
  * @param  string $indent
  * @return \Pop\Form\Form
  */
 public function __construct($action = null, $method = 'post', array $fields = null, $indent = null)
 {
     // Set the form's action and method.
     $this->action = null !== $action ? $action : $_SERVER['REQUEST_URI'];
     $this->method = $method;
     // Create the parent DOM element and the form child element.
     parent::__construct(null, 'utf-8', null, $indent);
     $this->form = new Child('form', null, null, false, $indent);
     $this->form->setAttributes(array('action' => $this->action, 'method' => $this->method));
     $this->addChild($this->form);
     if (null !== $fields) {
         $this->setFields($fields);
     }
 }