Re: class declared elsewhere
| From: | Babak Bandpey | Date: | Wed, 06 Dec 2000 11:17:00 +0000 |
| Subject: | Re: class declared elsewhere | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28879@lists.php.net to get a copy of this message | ||
It's actually very logical.
You write your classes inside an include file and and include it inside
your script. But remeber it shall be included before the line where you
need to create the object of that class.
like this
include "db_class.inc";
$db = new db_class();
Regards
Babak
Sergiy P Zhenochin wrote:
>
> is it possible in a script to instantiate classes defined in an included
> file?
> if yes, how does it differ from instantiation of classes defined in the
> same script?
>
> now I get:
> <b>Fatal error</b>: Cannot instantiate non-existent class:
> Thanks a lot.
> S
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net