için değişkenleri geçirerek ve bu sınıfPHP - Ben OOP öğrenmeye çalışıyorum sınıflara
class boo{
function boo(&another_class, $some_normal_variable){
$some_normal_variable = $another_class->do_something();
}
function do_stuff(){
// how can I access '$another_class' and '$some_normal_variable' here?
return $another_class->get($some_normal_variable);
}
}
yaptık ve ben
$bla = new boo($bla, $foo);
echo $bla->do_stuff();
gibi another_class
sınıf içinde bu bir yere çağırır Ama yok içinde referans olarak geçemiyor Lütfen
* (referans) * [Sınıfları ve Temelleri Nesneleri] (http: // www .php.net/manual/tr/language.oop5.basic.php) – Gordon
http://docs.php.net/this adresindeki '$ this 'hakkında bilgi edinin! – rik