RouteConfigurator example

/** * Adds a route. * * @param string|array $path the path, or the localized paths of the route */
    public function add(string $name, string|array $path): RouteConfigurator
    {
        $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);
        $route = $this->createLocalizedRoute($this->collection, $name$path$this->name, $this->prefixes);

        return new RouteConfigurator($this->collection, $route$this->name, $parentConfigurator$this->prefixes);
    }

    public function alias(string $name, string $alias): AliasConfigurator
    {
        return new AliasConfigurator($this->collection->addAlias($name$alias));
    }

    /** * Adds a route. * * @param string|array $path the path, or the localized paths of the route */
/** * Adds a route. * * @param string|array $path the path, or the localized paths of the route */
    public function add(string $name, string|array $path): RouteConfigurator
    {
        $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);
        $route = $this->createLocalizedRoute($this->collection, $name$path$this->name, $this->prefixes);

        return new RouteConfigurator($this->collection, $route$this->name, $parentConfigurator$this->prefixes);
    }

    public function alias(string $name, string $alias): AliasConfigurator
    {
        return new AliasConfigurator($this->collection->addAlias($name$alias));
    }

    /** * Adds a route. * * @param string|array $path the path, or the localized paths of the route */
Home | Imprint | This part of the site doesn't use cookies.