public function __construct() { $this->model = new Model(); $this->view = new View($this->model); $this->router = Router::getInstance(); $this->params = $this->router->getParams(); $this->format = ''; }
/** * The next lines describes minimal stuff required on index of project * Don't change this block unless you REALLY KNOW what you are doing */ require 'definitions.php'; require 'lib' . DS . 'designetecnologia' . DS . 'main' . DS . 'Autoload.php'; use designetecnologia\main\Router; $autoLoad = new Autoload(); $autoLoad->setPath(ROOT); $autoLoad->setExt('php'); spl_autoload_register(array($autoLoad, 'loadApp')); // Load files from app spl_autoload_register(array($autoLoad, 'loadModules')); // Load files from app/modules directly spl_autoload_register(array($autoLoad, 'loadCore')); // Load files from lib folder spl_autoload_register(array($autoLoad, 'load')); // Load files from root folder /** * Do not change the next lines * they are necessary to interpreting routes and render the results of requests * Instantiating designetecnologia\main\Router for handling URIs */ $router = Router::getInstance(); include_once 'routes.php'; $router->route(); $router->getBody(); if (isset($_SESSION['error']) && !is_array($_SESSION['error'])) { echo $_SESSION['error']; unset($_SESSION['error']); }