function __construct($type, $id, $name, $legend) { if ($type != "text" and $type != "password" and $type != "email") { throw new \InvalidArgumentException("Os únicos tipos aceitos para InputText são text, password e email"); } parent::__construct($id, $name, $type, $legend); }
function __construct($type, $id, $name, $legend, $class) { if ($type != "submit" and $type != "reset") { throw new \InvalidArgumentException("Os únicos tipos aceitos para Button são submit e reset"); } $this->class = $class; parent::__construct($id, $name, $type, $legend); }
function __construct($type, $id, $name, $legend, $checked = "") { if ($type != "radio" and $type != "checkbox") { throw new \InvalidArgumentException("Os únicos tipos aceitos para InputMark são radio e checkbox"); } $this->checked = $checked; parent::__construct($id, $name, $type, $legend); }
function __construct($id, $name, $legend, $rows, $cols) { if (!is_integer($rows) or !is_integer($cols)) { throw new \InvalidArgumentException("Os argumentos rows e cols devem ser números inteiros."); } $this->rows = $rows; $this->cols = $cols; parent::__construct($id, $name, null, $legend); }