Re: [PHP] question about compositing objects

2006-01-13 Thread Richard Lynch
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();

Re: [PHP] question about compositing objects

2006-01-12 Thread Tim Boring
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

Re: [PHP] question about compositing objects

2006-01-12 Thread comex
$map=new Map(); $this-map = new Map(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] question about compositing objects

2006-01-12 Thread Aaron Koning
$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();