Re: php and classes
| From: | Bogdan Stancescu | Date: | Fri, 16 Aug 2002 02:37:18 +0000 |
| Subject: | Re: php and classes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112900@lists.php.net to get a copy of this message | ||
So what happens exactly?
Pafo wrote:
i reed thru my code and i noticed that it wasent readable, like Dan said in one of my other post "xml and php". so i thought, why not create afew classes to make everything look good :) i managed to make this class, but it just dosent work,, anyone got any idea why it wont work..? <?php class Relic { var $RelicName; var $RelicType; var $RelicRealm; var $RelicOwner; function PrintInfo() { print "$this->RelicName : $this->RelicType : $this->RelicRealm : $this->RelicOwner<br>"; } function CheckForPrint() { if ($this->RelicName == "" || $this->RelicType == "" || $this->RelicRealm == "" || $this->RelicOwner == "") { return false; } else { return true; } } function Clean() { $this->RelicName = ""; $this->RelicType = ""; $this->RelicRealm = ""; $this->RelicOwner = ""; } function SetName($name) {$this->RelicName = $name;} function SetType($type) { $this->RelicType = $type; } function SetRealm($realm) { $this->RelicRealm = $realm; } function SetOwner($owner) { $this->RelicOwner = $owner; } function DebugPrint() { print $this->RelicName; } } $temp = new Relic; $temp->SetName("test"); $temp->DebugPrint; ?> i have tried, class Relic { }; <-------- dosent work regards patrick