예제 #1
0
파일: Request.php 프로젝트: neolao/php
 /**
  * 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';
 }
예제 #2
0
파일: Site.php 프로젝트: neolao/php
 /**
  * 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);
 }