function __construct($controller, $action, URL $url = null) { if (is_null($url)) { $url = new URL(); $url->load(); } $this->controller = $controller; $this->action = $action; $this->url = $url; }
function __construct(Request $request, URL $url = null) { if (is_null($url)) { $url = new URL(); $url->load(); // Request убивает двоеточия в URL, поэтому используется $_SERVER['REQUEST_URI'] } $this->setRequest($request); $this->setUrl($url); $this->init(); }
function __construct(URL $url = null, $controllers_path = null) { if (is_null($url)) { $url = new URL(); $url->load(); } if (!is_null($controllers_path)) { $this->setControllersPath($controllers_path); } $this->setURL($url); $this->init(); }