Sets the pattern.
This method implements a fluent interface.
string $pattern The pattern:
Route The current Route instance
public function setPattern($pattern) {
$this->pattern = trim($pattern);
// a route must start with a slash
if ('' === $this->pattern || '/' !== $this->pattern[0]) {
$this->pattern = '/' . $this->pattern;
}
$this->compiled = null;
return $this;
}