11-30-2007, 01:38 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Nov 2007
Posts: 14
Thanks: 1
|
Is referencing a class bad practice?
Just wondering is referencing a class in another class bad? Like so
PHP Code:
<?php
class test
{
var $testing = "";
function blah()
{
return $this->testing;
}
}
?>
And then in another file
PHP Code:
<?php
//include the file with the class above in
class two
{
var $test = "";
function two ( &$test )
{
$this->test = $test;
}
function again ()
{
$data = $this->test->blah();
return $data;
}
}
?>
Hope that makes sense? :p
|
|
|
|