Re: classes in php
| From: | Cynic | Date: | Fri, 05 Jan 2001 14:54:46 +0000 |
| Subject: | Re: classes in php | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4834@lists.php.net to get a copy of this message | ||
Or, rather:
class box
{
var $props = array() ;
function box( $props )
{
$this->props = $props ;
}
}
class print
{
var $i = 0 ;
addBox( $props )
{
$this->i++ ;
$this->box$i = new box( $props ) ;
}
}
$prt = new print() ;
$prt->addBox( 'hello' ) ;
At 15:41 5.1. 2001, Cynic wrote the following:
--------------------------------------------------------------
>class box
>{
> # whatever
>}
>
>class print
>{
> var $boxes = array() ;
> addBox( $box )
> {
> $this->boxes[] = $box ;
> }
>}
>
>$prt = new print() ;
>$prt->addBox( $b = new box() ) ;
>
>
>
>At 15:31 5.1. 2001, IThelp wrote the following:
>--------------------------------------------------------------
>>I am working on a class for php. Does php allow subclasses like say Java.
>>Here is brief description of what I am working.
>>
>>I have an Object Print. It is made up of a various amount of Objects called
>>Boxes. So the boxes class is a subset of Print. How would this work in
>>PHP.
>>
>>Ryan
>>
>>
>>--
>>PHP Windows Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>>For additional commands, e-mail: php-windows-help@lists.php.net
>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>------end of quote------
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>cynic@mail.cz
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz