/** * Constructor */ public function __construct() { // Request method if (isset($_SERVER['REQUEST_METHOD'])) { $this->method = $_SERVER['REQUEST_METHOD']; } // Get the path info $this->pathInfo = Path::getPathInfo(); // Get parameters and sanitize them $this->_getParameters(); // Default values $this->controllerName = 'index'; $this->actionName = 'index'; }
/** * Constructor */ public function __construct() { // Initialize properties $this->_controllerHelpers = []; $this->_viewHelpers = []; // Get the base url $this->_baseUrl = Path::getBaseUrl(); // Create the router $this->_router = new Router(); // Create a request $this->_request = new Request(); // Create a default view renderer $this->_view = new View(); $this->_view->site = $this; // Register default helpers for the view $this->_addViewHelpers($this->_view); }