Thankyou Nilaab and Hatem for the replies.

I can see that extending classes is probably the way to go. I was kind of 
aware of how it works, but didn't see it as an obvious solution. But looking 
at it more closely, I think I should be able to put most common stuff in a 
basic class. Different kinds of pages can then be created by extension classes
with one or two unique functions, and the rest inherited ... pretty obvious 
really :)

Mick


Quoting "@ Nilaab" <[EMAIL PROTECTED]>:

> If these two classes are in separate files then you will need to include
> one
> of the classes in with the other class using the include() or require()
> functions. Have you also used the extends keyword to extend the main class?
> When you use inheritance properties, you can use the $this-> mechanism
> within the classes to reference all functions of both classes. Read about
> inheritance of classes for more information. If you already knew the above
> and it doesn't help you, then just ignore it. I'm just trying to narrow
> down
> your problem. Good luck.
> 
> 
> > -----Original Message-----
> > From: Michael Hall [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 13, 2003 12:20 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] class inside class
> >
> >
> > --
> >
> > 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: [EMAIL PROTECTED]                (08) 8951 8352
> > H: [EMAIL PROTECTED]                    (08) 8953 1442
> > ----------------------------------------------------
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


----------------------------------------------------
Michael Hall                 Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
Work: [EMAIL PROTECTED]             (08) 8951 8352
Home: [EMAIL PROTECTED]                  (08 8953 1442
----------------------------------------------------


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to