public function resource($controller, array $options = array())
    {
        $name       = isset($options["prefix"]) ? $options["prefix"] : "";
        $name      .= $this->getResourceName($controller, $options);
        $actions    = $this->getResourceActions($options);
        $resource = new RouteResource;

        foreach ($actions as $action => $map) {
            $resource->set(
                $this->set(
                    $map[0],
                    $this->getResourcePath($action, $map[1], $name, $options),
                    [$controller, $action]
                )
                    ->setName("$name.$action")
            );
        }

        return $resource;
    }