If I have following code in my controller:
$this->view->print = "<form method='{$method}'> //Some form things </form>";
And then I use execute echo $this->print; in my view, am I going out of the MVC pattern?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you are definitely not using it. The controller should not be responsible for presentation logic. That is the task for view instances. It means, no HTML in controllers.
Views in MVC design pattern are structures which deal with presentation logic and manipulate multiple templates. View is not a template.
Also, if possible, controller should not be rendering the view. Controller should be responsible for sending messages to view and model layer, which then cause change of state in said parts of MVC.