php and classes
| From: | Pafo | Date: | Fri, 16 Aug 2002 01:58:00 +0000 |
| Subject: | php and classes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-112892@lists.php.net to get a copy of this message | ||
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