Re: Classes

From: Date: Mon, 31 Mar 2003 13:39:16 +0000
Subject: Re: Classes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-141688@lists.php.net to get a copy of this message
including or requiring a file does not change the working directory, so if you have this structure: index.php A/ClassA.class.php B/ClassB.class.php and index.php includes A/ClassA.class.php, from ClassA.class.php you need to use include('B/ClassB.class.php'); Donahue Ben wrote:
I have a ClassA file and a ClassB file stored in separate directories. I am trying to get ClassB to initiate a ClassA object. But since they are stored in seperate directories I get an error. So I tried including the ClassA file in ClassB constructor: function ClassB() { include("../A/ClassA.class.php"); ... } i cant get this working. How do i solve this problem without having both class files in the same directory. Ben __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com


« previous php.general (#141688) next »