Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class IndexController {
- function index($args) {
- $data = array();
- $data['title'] = 'Index Page Title';
- $dbh = DB::getInstance();
- $dao = new NoteDAO($dbh);
- $data['notes'] = $dao->getNotes();
- $view = new IndexView($data);
- $view->render();
- }}
- class IndexView {
- public $data;
- function __construct($data) {
- $this->data = $data;
- }
- function render() {
- $data = $this->data; //scope for template
- include $_SERVER['DOCUMENT_ROOT'].'/template/indexTemplate.php';
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement