Hello! I'm working on a mini framework and everything is going great, exvept this one part that I have gotten working but it brings more complications and it's extremely confusing to me. So I will summarize what is going on. Essentially I have a class (a controller, we'll call this class A) that is extending another class (Class B), in class A I want the ability to say $this->fetch->view('main');
which I have gotten working, but it was of course taking place outside of class B and class A. I would like this to take place in class B somehow so these methods can change properties and such. I had an idea to somehow have it when the fetch class is referred to point back to class B so the methods could be contained in class B? I don't know if that makes any sense. I will try to illustrate it in code.
// So basically I would like to stylize this
$this->view('main');
//Into this
$this->fetch->view('main');
And maybe this is what whould happen by the scenes? (pseudo code)
class fetch {
WHEN I'M CALLED I'M GOING TO PASS IT ON TO YOU CLASS B
}
class B {
OH THANKS FOR THE PASS I WILL CALL THESE METHODS NOW, BUDDY
public function view(){
//stuff
}
}
Hopefully that makes some sense...
Thanks for any answers or suggestions.