Hi, i was wondering if the last line of the following code is possible
somehow (the second last works perfect) but say i wanted to automatically
get the id (or anything else for that particular window) would it be
possible? or would i have to include a new function in windows called setID
or something like that?
----------------php code-----------------------------
<?php
class house{
var $windows;
function house(){
$this->windows = new windows();
}
function getSize(){
return "Big House";
}
}
class windows{
var $id;
function windows($id = "all"){
$this->id = $id;
}
function showID(){
echo "<br>ID: " . $this->id;
}
}
$test = new house();
echo $test->getSize() . "<br>\n\n";
$test->windows->showID();
$test->windows("Window3")->showID();
?>
-------------------end php code--------------
I could always have $test->windows->setID($id) then display the properties
for that current window, but it would be sumpler if i could use
$test->windows($id)->showID() and if no var is there, show all...any ideas
on how to do this?
Thanks heaps
Luke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php