Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Controller {
- public $view;
- public $model;
- public function __construct($model, $view) {
- $this->setModel($model);
- $this->setView($view);
- }
- public function setModel($model) {
- $this->$model = $model;
- }
- public function setView($view) {
- $this->$view = $view;
- }
- public function addDataToView($name, $data) {
- $this->$view[$name] = $data;
- }
- public function renderTemplate($templateFile) {
- $this->$view->render($templateFile);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment