class inside class
| From: | Michael Hall | Date: | Mon, 13 Jan 2003 06:19:37 +0000 |
| Subject: | class inside class | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-131395@lists.php.net to get a copy of this message | ||
--
G'day:
I am using a 'wrapper' class to create all the boilerplate HTML on a website,
plus do stuff like authentication and print menus etc according to properties
set dynamically within the class.
The actual content of each page is generated by seperate 'content' classes.
These classes are 'embedded' within and instantiated within the wrapper class,
but are otherwise independent of it.
This system allows for something approaching a PHP "object publishing"
application, which is where I'm heading.
My problem is that now I need to get at the values of some wrapper class
properties from within a content class: in other words, I need to access the
dynamically assigned values of the properties of one class, from inside another
class (which is embedded within the first, though I'm not sure that really
matters).
I can't use the $this-> mechanism because the value is inside a different
class.
I can't use the first class's handle (eg $page , from $page = new WebPage())
because the embedded class doesn't know about it.
I have been playing around with declaring globals, and with PHP's class/object
functions, but have got nowhere yet.
Is this possible, and if so, does anyone have any pointers? Hope my description
of the problem makes sense.
TIA
Mick
----------------------------------------------------
MICHAEL HALL Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
W: mick.hall@nt.gov.au (08) 8951 8352
H: ninti@ninti.com (08) 8953 1442
----------------------------------------------------