I an new in OOP in PHP.
I am looking for a best practice how the modularize a php class. What I want is to define my class and then "load" methods for this class by including php files.
Here is some code to illustrate what I mean:
<?php /* module.php */
class MyClass_Module {
public function foo(){
print_r("Hello welt");
}
}
<?php /* somewhere else */
class MyClass {
function __construct($optionen = array()){
require_once("module.php");
}
}
$myObj = new MyClass();
$myObj->foo();