Hi.
Let's say i have two classes, a and b. I would like to use a's methods AND variables inside b's functions. How do i do that?
1.Do i instantiate a inside of b::__construct?
2.Do i use a::function()? - i don't think a::variable would work though
3.Other ideas?
I've read articles about the observer pattern. I don't think i understood much, but i don't think i can use it here, right?
I would like to have a MVC foundation classes-style approach. I want the Model class's methods and variables to be accesible from the Controller, and Controller's methods and variables to be accesible from within the templates of the View.
What would be easier and most straightforward?
Thank you.
classes and methods
Moderator: General Moderators
The Observer has nothing to do with it as far as I see it. What you really need is the Registry Pattern 
http://www.patternsforphp.com
http://phpbook.quantum-star.com/doku.php?id=contentlist (<-- We are still writing this book... Actually, we have just started)
http://phpbook.quantum-star.com/doku.php?id=contentlist (<-- We are still writing this book... Actually, we have just started)