AliasConfigurator example


    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 */
    public function __invoke(string $name, string|array $path): RouteConfigurator
    {
        return $this->add($name$path);
    }
}

    final public function alias(string $id, string $referencedId): AliasConfigurator
    {
        $ref = static::processValue($referencedId, true);
        $alias = new Alias((string) $ref);
        if (!$this->defaults->isPublic() || !$this->defaults->isPrivate()) {
            $alias->setPublic($this->defaults->isPublic());
        }
        $this->container->setAlias($id$alias);

        return new AliasConfigurator($this$alias);
    }

    /** * Registers a PSR-4 namespace using a glob pattern. */
    final public function load(string $namespace, string $resource): PrototypeConfigurator
    {
        return new PrototypeConfigurator($this$this->loader, $this->defaults, $namespace$resource, true, $this->path);
    }

    /** * Gets an already defined service definition. * * @throws ServiceNotFoundException if the service definition does not exist */

    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 */
    public function __invoke(string $name, string|array $path): RouteConfigurator
    {
        return $this->add($name$path);
    }
}

    final public function alias(string $id, string $referencedId): AliasConfigurator
    {
        $ref = static::processValue($referencedId, true);
        $alias = new Alias((string) $ref);
        if (!$this->defaults->isPublic() || !$this->defaults->isPrivate()) {
            $alias->setPublic($this->defaults->isPublic());
        }
        $this->container->setAlias($id$alias);

        return new AliasConfigurator($this$alias);
    }

    /** * Registers a PSR-4 namespace using a glob pattern. */
    final public function load(string $namespace, string $resource): PrototypeConfigurator
    {
        return new PrototypeConfigurator($this$this->loader, $this->defaults, $namespace$resource, true, $this->path);
    }

    /** * Gets an already defined service definition. * * @throws ServiceNotFoundException if the service definition does not exist */
Home | Imprint | This part of the site doesn't use cookies.