Hi
I've just made a simple class along the same lines as other classes i've made before - it contains just 1 method and a few vars. When i call the method i get
Fatal error: Call to undefined method: stdClass->writehtml() in /homez.29/stylhabi/www/groupe-styl-habitat/v2/styl-modeles.php on line 59
the class is definitely being instantiated and i can echo any of the vars - but it just won't accept that the function exists
here's the class :
lass write_modele {
var $title;
var $big;
var $small;
var $basepathImg;
function writeHtml(){
$this->html .= "<div class=\"modeles\">\n";
$this->html .= " <a href=\"images/".$this->big."\" rel=\"rokbox[750 450]\" title=\"".$this->title."\"><img src=\"images/".$this->small."\" alt=\"\" /></a>\n";
$this->html .= " <span class=\"cth2\">".$this->title."</span>\n";
$this->html .= "</div>\n";
return $this->html;
}// end writeHtml()
}
and here's how i call it
$aMod = new write_modele;
$aCont->title = $mods[$i]["title"];
$aCont->big = $mods[$i]["big"];
$aCont->small = $mods[$i]["small"];
$aCont->basepathImg = FR_SITE_ROOT.FR_DYNAMIC_FOLDER;
//echo $aCont->basepathImg.$mods[$i]["big"];
echo $aCont->writeHtml();
maybe there's some stupid mistake that I haven't noticed and some fresh eyes would spot it straight away
thanks for any help you can give me here
🙂