I'm familiar with objects classes and methods in JavaScript and it is very common to create a class, declare a method then write the function for that method outside of the class itself. Similar to what I have in the pseudo code below:
START CLASS PersonClass{
this.name = "DAVE";
this.getname = getname FUNCTION
}END CLASS
START FUNCTION getname {
PRINT Object.name
}END FUNCTION
How am I supposed to do this in a PHP class? Or is there a simple way to point a method (or object property) to an outside functions? If not then what are you supposed to do when you need a bunch of large functions in your class? Doesn't is get untidy quickly?
Thanks in advance.
START CLASS PersonClass{
this.name = "DAVE";
this.getname = getname FUNCTION
}END CLASS
START FUNCTION getname {
PRINT Object.name
}END FUNCTION
How am I supposed to do this in a PHP class? Or is there a simple way to point a method (or object property) to an outside functions? If not then what are you supposed to do when you need a bunch of large functions in your class? Doesn't is get untidy quickly?
Thanks in advance.