Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class IndexController {
  2. function index($args) {
  3. $data = array();
  4. $data['title'] = 'Index Page Title';
  5.  
  6. $dbh = DB::getInstance();
  7. $dao = new NoteDAO($dbh);
  8. $data['notes'] = $dao->getNotes();
  9.  
  10. $view = new IndexView($data);
  11. $view->render();
  12. }}
  13.  
  14. class IndexView {
  15. public $data;
  16. function __construct($data) {
  17. $this->data = $data;
  18. }
  19.  
  20. function render() {
  21. $data = $this->data; //scope for template
  22. include $_SERVER['DOCUMENT_ROOT'].'/template/indexTemplate.php';
  23. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement