On Thu, January 12, 2006 4:13 pm, jonathan wrote:
I have a class which creates another class within it such as:
class Loc{
public function outputInfo()
{
$map=new Map();
$map-setKey();
}
}
In my main page can I access the $map object like this:
$loc=new Loc();
Hi, Jonathan!
On Thu, 2006-01-12 at 14:13 -0800, jonathan wrote:
I have a class which creates another class within it such as:
class Loc{
public function outputInfo()
{
$map=new Map();
$map-setKey();
}
}
In my main page can I access the
$map=new Map();
$this-map = new Map();
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$map is not a member variable of the Loc class in your code...
Instead do this:
class Loc {
// Defines a member variable
var $map;
// Constructor
function Loc() {
$this-map = new Map(); // Create map object and save to Loc object
$this-map-setKey();
}
}
$loc = new Loc();
4 matches
Mail list logo