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

  • MandMEvangelists

    MandMEvangel

    28 Ocak 2008
  • pendrop gaming

    pendrop gami

    4 ŞUBAT 2013
  • The Verge

    The Verge

    8 AĞUSTOS 2006