ajlisowski Posted June 14, 2010 Share Posted June 14, 2010 This is more a general MVC question in regards to how ZF actually works. How does the view object render the phtml files? Like, lets say one was building their own framework. You have a controller object which has a view object as a member. That view object would call index.phtml which would be able to access $this-> to have access to the view object. But how does the code in that phtml file get rendered? How does the view object call that file and manage to output its contents. Does the object simply include the file? How can the controller pass variables to the view class for use? Like, if I were to say $this->view->obj=$this->obj, and my view class doesnt have a obj object, I will get the error: Undefined property: basic_view::$obj How does ZF do the things it does? Quote Link to comment Share on other sites More sharing options...
ignace Posted June 14, 2010 Share Posted June 14, 2010 Does the object simply include the file? Yes. How can the controller pass variables to the view class for use? __set($offset, $value), __get($offset) Quote Link to comment Share on other sites More sharing options...
ajlisowski Posted June 14, 2010 Author Share Posted June 14, 2010 Hey, thanks! I was having the view object have a data array and throwing needed objects in there. using __set() will take out that middleman. I constantly see your name answering my questions, I'll buy you a coke some day. Quote Link to comment Share on other sites More sharing options...
Mchl Posted June 14, 2010 Share Posted June 14, 2010 I constantly see your name answering my questions, I'll buy you a coke some day. It better be good Colombian one Quote Link to comment Share on other sites More sharing options...
ignace Posted June 14, 2010 Share Posted June 14, 2010 I constantly see your name answering my questions, I'll buy you a coke some day. It better be good Colombian one My sinuses are already screwed due to all the drug-abuse What are the chances you'll ever really do that? Buy me a book and ship it to me, so that I can help you even better in the future Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.