key = $key; $this->callback = $callback; $this->parameters = $parameters; } /** * Get all of the "before" filters defined for the route. * * @return array */ public function before() { return $this->filters('before'); } /** * Get all of the "after" filters defined for the route. * * @return array */ public function after() { return $this->filters('after'); } /** * Get an array of filters defined for the route. * * * // Get all of the "before" filters defined for the route. * $filters = $route->filters('before'); * * * @param string $name * @return array */ private function filters($name) { return (is_array($this->callback) and isset($this->callback[$name])) ? explode(', ', $this->callback[$name]) : array(); } }