You are here: Re: Calling a subclass's method « PHP Programming Language « IT news, forums, messages
Re: Calling a subclass's method

Posted by Rik on 06/14/06 09:59

Ramon wrote:
> Thanks Rik,
>
> this does work.
> I'm sorry that I keep asking, but I'm trying to understand this.
>
> I wonder if this is the correct way to address the $m_oTextBoxes
> array. That array should be treated as if it were private, I
> suppose..?

In PHP4, it cannot be made private.
An array in an object is just like any other array, so it's the correct way
of adressing it.


> Actually, I should have an interface method to call this array:

I've been trying some things, it seems it cannot be done in one line, except
when using constructs like:
call_user_func(array($oForm->getgetTextBoxByID("Nr"), 'outerHTML));

But I'm no real OOP programmer, maybe someone else could enlighten you.

> Then, I still have the question how to call the right instance of the
> TextBox-class's getOuterHTML method.
>
> Because this will not work here: echo
> $oForm->m_oTextBoxes["Nr"]->getOuterHTML();

First it does work, now it doesn't work? Works perfectly here.

If it actually doesn't work, try turning on error_reporting and var_dump()
your objects. (For instance, in the example code you forgot to instantiate
the $oForm object).

If you mean it isn't suitable to your needs, perhaps some more detailed
explanation of your exact needs are in order.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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