SORU
12 Kasım 2009, PERŞEMBE


Sınıf yöntemi?içinde fonksiyon çağırma

Bunu yapma hakkında gitmek nasıl anlamaya çalışıyorum ama oldukça eminim.

Burada yapmaya çalışıyorum ne bir örnek:

class test {
     public newTest(){
          function bigTest(){
               //Big Test Here
          }
          function smallTest(){
               //Small Test Here
          }
     }
     public scoreTest(){
          //Scoring code here;
     }
}

İşte ben sorun yaşıyorum parçası, nasıl bigTest diyebilir miyim()?

CEVAP
12 Kasım 2009, PERŞEMBE


Şunu deneyin:

class test {
     public function newTest(){
          $this->bigTest();
          $this->smallTest();
     }

     private function bigTest(){
          //Big Test Here
     }

     private function smallTest(){
          //Small Test Here
     }

     public function scoreTest(){
          //Scoring code here;
     }
}

$testObject = new test();

$testObject->newTest();

$testObject->scoreTest();

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Dumb Stupid Videos

    Dumb Stupid

    26 Kasım 2013
  • LardTardProductions's channel

    LardTardProd

    10 NİSAN 2009
  • TheRightTire

    TheRightTire

    14 EKİM 2009