Advertisement
fabi0

Untitled

Jun 20th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  * To change this template file, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  * Description of mainController
  11.  *
  12.  * @author fabi0
  13.  */
  14.  
  15. namespace Load;
  16.  
  17. class Controller {
  18.  
  19.     /**
  20.      *
  21.      * @var \Models\Database
  22.      */
  23.     protected $_databaseInstance;
  24.  
  25.     public function __construct() {
  26.         $this->_databaseInstance = new \Models\Database(\Models\Config::mysql_host, \Models\Config::mysql_dbName, \Models\Config::mysql_username, \Models\Config::mysql_password);
  27.         $sess = new \Models\Sessions($this->_databaseInstance);
  28.         $sess->start_session(\Models\Config::cookie_session_name, false);
  29.     }
  30.  
  31.     protected function render($path, $data = array()) {
  32.         $data['baseUrl'] = \Models\Config::base_url;
  33.         include "Views/" . $path . '.php';
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement