static function name($name, $remove_path = false) { if ($remove_path == true) { $name = self::filename($name); } $dot = strrpos($name, '.'); if ($dot) { $name = substr($name, 0, $dot); } return $name; }
function crawl() { $path = url::strip_query($this->raw); $path = (array) str::split($path, '/'); if (a::first($path) == 'index.php') { array_shift($path); } // parse params foreach ($path as $p) { if (str::contains($p, ':')) { $parts = explode(':', $p); if (count($parts) < 2) { continue; } $this->params->{$parts}[0] = $parts[1]; } else { $this->path->_[] = $p; } } // get the extension from the last part of the path $this->extension = f::extension($this->path->last()); if ($this->extension != false) { // remove the last part of the path $last = array_pop($this->path->_); $this->path->_[] = f::name($last); } return $this->path; }