public function rest($pattern, $action) { is_array($action) ? $action['__rest'] = 1 : ($action = ['__rest' => 0, '__action' => $action]); $this->addRoute($this->httpMethod, $pattern, $action); return $this; }