Guest User

Untitled

a guest
Sep 16th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2. class Controller {
  3.     public $view;
  4.     public $model;
  5.  
  6.     public function __construct($model, $view) {
  7.         $this->setModel($model);
  8.         $this->setView($view);
  9.     }
  10.  
  11.     public function setModel($model) {
  12.         $this->$model = $model;
  13.     }
  14.  
  15.     public function setView($view) {
  16.         $this->$view = $view;
  17.     }
  18.  
  19.     public function addDataToView($name, $data) {
  20.         $this->$view[$name] = $data;
  21.     }
  22.  
  23.     public function renderTemplate($templateFile) {
  24.         $this->$view->render($templateFile);
  25.     }
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment