public function get() { if (is_array($this->filters)) { $this->filters = Sanitize::rules($this->filters); } return Request::post($this->name, $this->default, $this->filters); }
/** * 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; }