Complete the code to define the Model class in MVC.
<?php class [1] { public function getData() { return "Data from model"; } } ?>
The Model class handles data and business logic in MVC.
Complete the code to call the View in MVC.
<?php class Controller { public function show() { $view = new [1](); $view->render(); } } ?>
The Controller calls the View to display data.
Fix the error in the Controller method to get data from Model.
<?php class Controller { public function getData() { $model = new Model(); return $model->[1](); } } ?>
The Model's method to get data is getData().
Fill both blanks to create a simple MVC flow: Controller calls Model and then View.
<?php class Controller { public function display() { $model = new [1](); $data = $model->getData(); $view = new [2](); $view->render($data); } } ?>
The Controller creates a Model to get data and a View to render it.
Fill all three blanks to complete the MVC interaction: Controller gets data, passes to View, and View renders.
<?php class Controller { public function show() { $model = new [1](); $data = $model->getData(); $view = new [2](); $view->[3]($data); } } ?>
The Controller creates a Model to get data, a View to display it, and calls render() on the View.
