Re: sytax error, but where?
- From: "Janwillem Borleffs" <jw@xxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 13:49:48 +0100
carlton wrote:
> PictureList[] is supposed to be an array of C_PictureList objects,
> not a member of the C_PictureList class.
>
You are defining PictureList in the class, which makes it a class member or
a property at least, regardless of what it contains.
Therefore, you are bounded to some restrictions regarding the syntax. If you
don't want it to be member of the class, but accessible through it, one
option would be to define it as a static variable within a class method:
<?php
class C_PictureList {}
class C_Category {
function accessPictureList($new_value = null) {
static $PictureList = array();
if (is_object($new_value)) {
$PictureList[] = $new_value;
} else {
return $PictureList;
}
}
}
// Set
C_Category::accessPictureList(new C_PictureList);
// Get
print_r(C_Category::accessPictureList());
?>
JW
.
- References:
- sytax error, but where?
- From: carlton
- Re: sytax error, but where?
- From: Oli Filth
- Re: sytax error, but where?
- From: carlton
- Re: sytax error, but where?
- From: Janwillem Borleffs
- Re: sytax error, but where?
- From: carlton
- sytax error, but where?
- Prev by Date: Re: sytax error, but where?
- Next by Date: Re: MySQL Problem
- Previous by thread: Re: sytax error, but where?
- Next by thread: MySQL Problem
- Index(es):