/** * @param string $name * @param string|array $content * @param array $attributes */ public function __construct($name, $content = null, $attributes = array()) { parent::__construct(); // Sets the tagname $this->setName($name); // Determines if content is a string // or other child nodes which will // be appended if (is_string($content)) { $this->setContent($content); } else { if (is_array($content)) { foreach ($content as $child) { if ($child instanceof Node) { $this->append($child); } } } } // Add the attributes if (!empty($attributes)) { $this->setAttributes($attributes); } }
/** * @param string $value */ public function __construct($value = '') { parent::__construct(); $this->setValue($value); }