I want to call a function of main class to a child class. But here child class is not directly connected with parent class . Please see my code below.
main-class.php
class Main_Class {
public function __construct() {
$this->include_files();
}
public function include_files(){
include_once('first_class.php');
}
public function my_parent_function(){
echo 'this is my super parent_function';
}
}
first_class.php
class First_class {
public function __construct() {
$this->include_files_1();
}
public function include_files_1(){
include_once('my_abstaract_class.php');
include_once('second_class.php');
}
}
my_abstaract_class.php
abstract class My_abstaract_class {
...
}
second_class.php
class Second_class extends My_abstaract_class {
public function __construct() {
$this->my_child_function();
}
public function my_child_function(){
$this->my_parent_function();
}
}
Here i want to call my_parent_function()
inside second_class.php. How can I do this? When I tried $this->my_parent_function();
it's not working.