RE: [PHP] OOP
| From: | John W. Holmes | Date: | Thu, 16 Jan 2003 04:02:24 +0000 |
| Subject: | RE: [PHP] OOP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131808@lists.php.net to get a copy of this message | ||
> > I'd recommend you make a separate database class and error class
that
> each
> > of your other classes access. That would make it the most modular
and
> > re-usable.
> >
> > ---John Holmes...
>
> I was hoping someone would say that :)
> How could I code that though. I've only just started with OOP and
don't
> understand how I can inherit methods to classes? Is it a good idea to
> create
> a new object within each class which, for example, needs to do
database
> stuff
> or should I inherit the methods?
Inheriting would probably be the most modular.
> I haven't found any clear examples of this kind of OOP, only the real
> basics
> (which I still need help with by the way :) ).
Use google. Do some more studying before you try to tackle this, or look
on phpclasses.org for some examples.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/