slappyjaw
11-12-2010, 08:58 PM
Currently i have been working on this project for a networking script and i am almost done with the class that i am making for it. The thing is is that the thing is huge and all the functions for the site are in that class, is there a way to break it up so that i can have one class that calls it and other classes that branch off of that class that are accessible by the main class?!:eek: for example
// The main class
class main{
function hello(){
echo "hello!";
}
}
// Then the sub classes
class sub{
function welcome(){
echo "welcome";
}
class sub2{
function bye(){
echo "bye.";
}
// Now when i call the class can i make it so that i can do it like this.
$main = new main();
$main->hello();
$main->welcome();
$main->bye();
}
}
Thans for any help in advance!
// The main class
class main{
function hello(){
echo "hello!";
}
}
// Then the sub classes
class sub{
function welcome(){
echo "welcome";
}
class sub2{
function bye(){
echo "bye.";
}
// Now when i call the class can i make it so that i can do it like this.
$main = new main();
$main->hello();
$main->welcome();
$main->bye();
}
}
Thans for any help in advance!