Witam,
<?php
//zmienne przekazane:
//$name, $surname, $email
class parents
{
function callFunction($name, $surname, $email)
{
$this->setData($name, $surname, $email);
$this->xx();
$this->setidparent();
//jeszcze kilka innych, ktore omijam
}
protected function setData($name, $surname, $email)
{
$this->name=$name;
$this->surname=$surname;
$this->email=$email;
}
protected function xx ()
{
$this->id=$id;
}
protected function setidparent()
{
$IDparent=$this->id;
if($IDparent == null)
return $IDparent;
}
}
class y
{
function yy()
{
$x=$parent->$this->setidparent(); w TEJ FUNKCJI CHCIALBYM ZEBY MI SIE WYSWIETLILO $id z funkcji xx z klasy parents
}
}
$parent = new parents;
$parent -> callFunction($name, $surname, $email);
$student = new y;
$student -> yy();
?>
Wartosc $id z funckji xx klasy parents powinna byc wyswietlona poprzez wywolanie funkcji yy z klasy y
Dostaje rózne errory, pewnie to jest jakiś syntax error o którym nie wiem, proszę o pomoc.
Dzięki, doszedlem już do tego sam (IMG:
style_emoticons/default/wink.gif)