Reply to Re: question about compositing objects

Your name:

Reply:


Posted by Mark on 01/13/06 02:35

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();
>
> $loc->map->publicMapFunction();
>
> I thought I would be able to but it doesn't seem like it.
>
> thanks in advance.
>
> -jonathan


Try this:
class Loc
{
public var $map;
function oputputInfo()
{
$this->map = new Map();
}
};

$loc = new Loc();
$lock->outputInfo();

$loc->map->publicMapFunction();

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация