Re: adding functions to a class
| From: | Sean C. McCarthy | Date: | Tue, 04 Sep 2001 20:51:42 +0000 |
| Subject: | Re: adding functions to a class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65944@lists.php.net to get a copy of this message | ||
Hi,
What you are looking for is the OOP class extension. Look for "extends".
Sean C. McCarthy
SCI, S.L. (www.sci-spain.com)
Jeroen Olthof wrote:
>
> hi,
>
> picture I have a class with some variable holding the information of this
> class. Now there are some functions to manipulate the vars. well, you nou
> what classes are about. but now I want to add functions that are located in
> a different php file. but this functions need to use the the var of the
> class.
>
> bassicly what a want is extends the original class with more functionalities
> like. you could see it as adding plug-ins in a program. So I don't want to
> just copy past the functions in the original class file.
>
> class a {
>
> var VAR1
> var VAR2
> var VAR3
>
> require(morefunctions.php);
>
> function a($param) {
> ......
> }
>
> function test2($param) {
> ......
> }
> }
>
> the require(morefunctions.php); will ofcource not work but bassicly this is
> what I want. en all the functions added should be able to use VAR1 VAR2 VAR3
> (and the other functions that are allready in the class)
>
> is there a why to do this ??
>
> kind regards
> Jeroen Olthof
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net