myclass.php
class myclass {
private $name;
public function showData(){
include_once "extension.php";
otherFunction($this);
}
private function display(){
echo "hello world!";
}
}
extension.php
function otherFunction($obj){
if(isset($obj){
$obj->display();
}
}
Ok, so this is the issue, for some of you it is obvious that I am calling a private method from an include file which obviously will throw an error. My question is:
1. Is there a way that an include file can use external functions to call private methods?
2. How could I use an included file to access private methods and by doing so extending my functions to another file without making my class file so bloated with many functions?
3. Is that even possible?
Thanks