PHP beginner |
|
Hmz, ik vind uwe constructor nergens terug... die is toch verplicht?
Meestal initieer ik eerst de variabelen, zoals gij dat in de eerste paragraaf doet, maar effectief waarden toekennen doe ik in de constructor:
<?
class upload_afbeeldingen {
//eerst alle data ophalen ;-)
//cat
private $cat;
//afbeelding opties
private $afb_breedte;
private $afb_hoogte;
private $resize;
private $watermerk;
private $watermerk_pad;
private $afb_map;
//thumbs?
private $thumben;
private $thumb_breedte;
private $thumb_hoogte;
private $thumb_map;
//upload
private $hernoem;
private $upload_extensies;
private $upload_types;
private $new_naam;
private $naam;
private $tmp_name;
private $type;
private $map;
//foutmelding
public $foutmelding;
function __construct() {
$this->cat = '';
$this->afb_breedte = 500;
$this->afb_hoogte = 500;
$this->resize = FALSE;
$this->watermerk = FALSE;
$this->watermerk_pad = 'watermerk.png';
$this->private $afb_map = '../images/foto/full/';
$this->thumben = TRUE;
$this->thumb_breedte = 150;
$this->thumb_hoogte = 150;
$this->thumb_map = '../images/foto/thumb/';
$this->hernoem = FALSE;
$this->upload_extensies = 'jpg,jpeg,gif,png';
$this->upload_types = 'image/jpg,image/jpeg,image/gif,image/png';
$this->new_naam = FALSE;
$this->naam = '';
$this->tmp_name = '';
$this->type = '';
$this->map = '';
$this->foutmelding = '';
}
}
?>
<? class upload_afbeeldingen { //eerst alle data ophalen ;-) //cat private $cat; //afbeelding opties private $afb_breedte; private $afb_hoogte; private $resize; private $watermerk; private $watermerk_pad; private $afb_map; //thumbs? private $thumben; private $thumb_breedte; private $thumb_hoogte; private $thumb_map; //upload private $hernoem; private $upload_extensies; private $upload_types; private $new_naam; private $naam; private $tmp_name; private $type; private $map; //foutmelding public $foutmelding; function __construct() { $this->cat = ''; $this->afb_breedte = 500; $this->afb_hoogte = 500; $this->resize = FALSE; $this->watermerk = FALSE; $this->watermerk_pad = 'watermerk.png'; $this->private $afb_map = '../images/foto/full/'; $this->thumben = TRUE; $this->thumb_breedte = 150; $this->thumb_hoogte = 150; $this->thumb_map = '../images/foto/thumb/'; $this->hernoem = FALSE; $this->upload_extensies = 'jpg,jpeg,gif,png'; $this->upload_types = 'image/jpg,image/jpeg,image/gif,image/png'; $this->new_naam = FALSE; $this->naam = ''; $this->tmp_name = ''; $this->type = ''; $this->map = ''; $this->foutmelding = ''; } } ?>
Ik denk dat het dan wel zal werken...
snorry voor de late reactie, maar ik zag deze plots staan... |