/** * Set URL * @param string $url * @return \Touchbase\Control\HTTPRequest */ protected function setUrl($url) { $this->_url = $url; if (Router::isRelativeUrl($url)) { $this->_url = preg_replace(array('/\\/+/', '/\\/$/'), array('/', ''), $this->_url); } if (preg_match('/^(.*)\\.([A-Za-z][A-Za-z0-9]*)$/', $this->_url, $matches)) { $this->_url = $matches[1]; $this->_extension = $matches[2]; } if ($this->_url) { if (strpos($this->url, "/") === 0) { $this->urlSegments = explode("/", substr($this->_url, 1)); } else { $this->urlSegments = explode("/", $this->_url); } } return $this; }