Reply to Re: Calling a subclass's method

Your name:

Reply:


Posted by Tony Marston on 06/14/06 08:21

What you are describing is not a subclass but a contained object. A subclass
inherits from a superclass whereas you are instantiating an object from
within another object. There is a difference.

What you want is this...

$oForm->getTextBoxByID->getOuterHTML("Number");

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


"Ramon" <itsramon@zonnet.nl> wrote in message
news:448fc280$0$31637$e4fe514c@news.xs4all.nl...
> Hello
>
> I'm new to OOP in PHP and I have this question:
>
> I have a class called "Form", which contains a collection of classes
> (objects) called "Textbox".
> Now I need to call the Textbox class's method "getOuterHTML()".
>
> In Visual Basic, you should do it like this:
> oForm.getTextBoxByID("Number").getOuterHTML()
>
> In PHP I tried this: $oForm->getTextBoxByID("Number")->getOuterHTML();
> But that doesn't work...
>
> Is there a way to do this in one statement? (I use PHP4).
>
>
> Thanks in advance!
> Ramon.
>

[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

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