示例#1
0
 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;
 }
示例#2
0
 /**
  * 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;
 }