note 46040 deleted from function.include by aidan

From: Date: Tue, 28 Sep 2004 12:06:28 +0000
Subject: note 46040 deleted from function.include by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77479@lists.php.net to get a copy of this message
Note Submitter: thiago_mata at yahoo dot com dot br ---- <? //\\ File1.php //\\ /* You can use the include inside of your objects functions. They will can acess another functions of the object, variables using the "this" command just like you would make inside the class. But don't need more to be that big file. The includes are just maded when they are really needed. */ class People { var $MyName = 'Bob'; function SayHello($Him) { print "I am enter in the say hello function <br> "; return "<b> Hello ".$Him."! <br> </b>"; } function Introduce() { print "I am enter in the introduce function <br> "; return "<b> Hi, my name is ".$this->MyName." <br> </b>"; } function Meet($People) { print "I am enter in the meet function <br> "; //\\ Where the magic happens //\\ return include("File2.php"); } } $Actual = new People; print $Actual->Meet('Bob'); print $Actual->Meet('Marie'); ?> ------------------------------------------------------------------ <? //\\ File2.php //\\ print "I am enter in the include function <br> "; if ($People == $this->MyName) { return $this->Introduce(); } else { return $this->SayHello($People); } /* Enjoy.. ":^D Thiago Mata */ ?>

« previous php.notes (#77479) next »