Hey..just wondering if i can have 2 constructors? if so, would I just have:
class TreeViewNode{
public $child;
public $parent = "";
public $key = "";
public $data = "";
public $next;
public $section;
function __construct($k, $p, $d)
{
$this->parent = $p;
$this->key = $k;
$this->data = $d;
}
function __construct($k, $p, $d,$s)
{
$this->parent = $p;
$this->key = $k;
$this->data = $d;
$this->section = $s;
}
//all other class functionos
}
would I just do it just like that?
edit** I read something....is this the right way to do it, doesnt seem that correct
function __construct($k, $p, $d, $s='')
{
$this->parent = $p;
$this->key = $k;
$this->data = $d;
$this->section = $s;
}
thanks!