コード例 #1
0
ファイル: Post.php プロジェクト: romeoz/rock
 public function get()
 {
     if (is_array($this->filters)) {
         $this->filters = Sanitize::rules($this->filters);
     }
     return Request::post($this->name, $this->default, $this->filters);
 }
コード例 #2
0
ファイル: Route.php プロジェクト: romeoz/rock
 /**
  * Match url.
  *
  * @param string $pattern regexp-pattern
  * @param string $url
  * @return bool
  */
 protected function match($pattern, $url)
 {
     if (preg_match($pattern, $url, $matches)) {
         $result = [];
         foreach ($matches as $key => $value) {
             if (is_int($key)) {
                 continue;
             }
             $result[$key] = Sanitize::rules($this->sanitizeRules)->sanitize($value);
         }
         $this->params = array_merge($this->params, $result);
         return true;
     }
     return false;
 }