public function getQueryParams() { if ($this->queryParams) { return $this->queryParams; } if ($this->uri == null) { return null; } parse_str($this->uri->getQuery(), $this->queryParams); return $this->queryParams; }
/** * Get the suffix of the route. * * For example: * '/abc/xyz.json' -> 'json' * '/xyz.xml' -> 'xml' * * @return string */ public function getSuffix() { $suffix = ''; $path = $this->uri->getPath(); $chips = explode('/', $path); // last chip $chip = $chips[count($chips) - 1]; if (($pos = strrpos($chip, '.')) !== false) { $suffix = substr($chip, $pos + 1); } return $suffix; }