Re: [PHP] Assigning functions

2008-05-05 Thread Philip Thompson
On May 2, 2008, at 2:42 PM, Craige Leeder wrote: Hello Philip First thing first: design patterns are your friend. A good reference for which, is: http://www.fluffycat.com/PHP-Design-Patterns/ Second of all. What is the situation in which you are trying to do this? I can't really think of one

Re: [PHP] Assigning functions

2008-05-02 Thread David Otton
2008/5/2 Philip Thompson <[EMAIL PROTECTED]>: > Hi all. I have several classes. Within each class, a new class is called. Is > there a way to assign a function in a *deeper* class to be called in the > first class? Example to follow.. > >class A { > function __construct () { > $

Re: [PHP] Assigning functions

2008-05-02 Thread Nathan Nobbe
On Fri, May 2, 2008 at 1:48 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > On Fri, May 2, 2008 at 1:09 PM, Philip Thompson <[EMAIL PROTECTED]> > wrote: > >> Hi all. I have several classes. Within each class, a new class is called. >> Is there a way to assign a function in a *deeper* class to be cal

Re: [PHP] Assigning functions

2008-05-02 Thread Nathan Nobbe
On Fri, May 2, 2008 at 2:03 PM, Craige Leeder <[EMAIL PROTECTED]> wrote: > ons here) as a simple example something like this > > > > class B { > > //... > > function doSomething() { > > return $this->c->doSomething(); > > } > > } > > > > which allows you this in A instances > > > >

Re: [PHP] Assigning functions

2008-05-02 Thread Craige Leeder
ons here) as a simple example something like this > > class B { > //... > function doSomething() { > return $this->c->doSomething(); > } > } > > which allows you this in A instances > > $this->b->doSomething(); > > this is the preferred approach, since A and C instances are loosely

Re: [PHP] Assigning functions

2008-05-02 Thread Nathan Nobbe
On Fri, May 2, 2008 at 1:09 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > Hi all. I have several classes. Within each class, a new class is called. > Is there a way to assign a function in a *deeper* class to be called in the > first class? Example to follow.. > > class A { >function _

Re: [PHP] Assigning functions

2008-05-02 Thread Craige Leeder
Hello Philip First thing first: design patterns are your friend. A good reference for which, is: http://www.fluffycat.com/PHP-Design-Patterns/ Second of all. What is the situation in which you are trying to do this? I can't really think of one where you would do such a thing. - Craige On Fri,

[PHP] Assigning functions

2008-05-02 Thread Philip Thompson
Hi all. I have several classes. Within each class, a new class is called. Is there a way to assign a function in a *deeper* class to be called in the first class? Example to follow.. b = new B (); // I want to do the following. This does not work, of course. $this->doSomet