RE: [phplib] Objects and Classes From: Philippe Paravicini (philippe <email protected>)
Date: 07/19/00

Did you make sure that $this->MenuItems[0] actually exists?

> -----Original Message-----
> From: Nicolas di Tada [mailto:nicdit <email protected>]
> Sent: Monday, July 17, 2000 7:03 AM
> To: Phplib
> Subject: [phplib] Objects and Classes
>
>
> hi, im new in the list, and new with php, im having some problems with
> classes and objects. Its seems like i cant get a property from an object
> that is member of another object. Can anyone help me? My problem
> appears at
> the end of the code, in the for, i cant get any of the properties of the
> tmp...ill appreciate any help, i really dont know what to do...
>
> thank you
>
> nicolas
>
>
>
> <?
>
> class MenuItem
> {
> var $Name;
> var $Title;
> var $URL;
> var $ImageURL;
> var $Parent;
>
> function MenuItem($Name = "", $Title = "", $URL = "",
> $ImageURL = "",
> $Parent = "")
> {
> $this->Name = $Name;
> $this->Title = $Title;
> $this->URL = $URL;
> $this->ImageURL = $ImageURL;
> $this->Parent = $Parent;
> }
> }
>
> class NavBar
> {
> var $MenuItems;
> var $ItemCount;
> var $TableId;
> var $TableWidth = 120;
>
> function AddMenuItem($MenuItem)
> {
> $this->MenuItems[$this->ItemCount] = new MenuItem;
> $this->MenuItems[$this->ItemCount] = $MenuItem;
>
> $this->ItemCount++;
> }
>
> function Make()
> {
> $tmp = new MenuItem;
>
> for($i=0 ; $i < $this->ItemCount ; $i++)
> {
> $tmp = $this->MenuItems[0];
> ....
> ...
> ....
>
> }
>
> }
> }
> ?>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>