Sets the pattern for the path.
This method implements a fluent interface.
string $pattern The path pattern:
Route The current Route instance
public function setPath($pattern) {
// A pattern must start with a slash and must not have multiple slashes at the beginning because the
// generated path for this route would be confused with a network path, e.g. '//domain.com/path'.
$this->path = '/' . ltrim(trim($pattern), '/');
$this->compiled = null;
return $this;
}