addHost example



    /** * Sets the host to use for all child routes. * * @param string|array $host the host, or the localized hosts * * @return $this */
    final public function host(string|array $host)static
    {
        $this->addHost($this->route, $host);

        return $this;
    }
}


    /** * Sets the host to use for all child routes. * * @param string|array $host the host, or the localized hosts * * @return $this */
    final public function host(string|array $host)static
    {
        $this->addHost($this->route, $host);

        return $this;
    }
}


        $routes = $this->createLocalizedRoute($collection$name$config['path']);
        $routes->addDefaults($defaults);
        $routes->addRequirements($requirements);
        $routes->addOptions($options);
        $routes->setSchemes($config['schemes'] ?? []);
        $routes->setMethods($config['methods'] ?? []);
        $routes->setCondition($config['condition'] ?? null);

        if (isset($config['host'])) {
            $this->addHost($routes$config['host']);
        }
    }

    /** * Parses an import and adds the routes in the resource to the RouteCollection. * * @return void */
    protected function parseImport(RouteCollection $collection, array $config, string $path, string $file)
    {
        $type = $config['type'] ?? null;
        


        $routes = $this->createLocalizedRoute($collection$name$config['path']);
        $routes->addDefaults($defaults);
        $routes->addRequirements($requirements);
        $routes->addOptions($options);
        $routes->setSchemes($config['schemes'] ?? []);
        $routes->setMethods($config['methods'] ?? []);
        $routes->setCondition($config['condition'] ?? null);

        if (isset($config['host'])) {
            $this->addHost($routes$config['host']);
        }
    }

    /** * Parses an import and adds the routes in the resource to the RouteCollection. * * @return void */
    protected function parseImport(RouteCollection $collection, array $config, string $path, string $file)
    {
        $type = $config['type'] ?? null;
        


    /** * Sets the host to use for all child routes. * * @param string|array $host the host, or the localized hosts * * @return $this */
    final public function host(string|array $host)static
    {
        $this->addHost($this->route, $host);

        return $this;
    }
}
public function __wakeup()
    {
        throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
    }

    public function __destruct()
    {
        if (null === $this->prefixes) {
            $this->collection->addPrefix($this->route->getPath());
        }
        if (null !== $this->host) {
            $this->addHost($this->collection, $this->host);
        }

        $this->parent->addCollection($this->collection);
    }

    /** * Creates a sub-collection. */
    final public function collection(string $name = ''): self
    {
        return new self($this->collection, $this->name.$name$this$this->prefixes);
    }
public function __wakeup()
    {
        throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
    }

    public function __destruct()
    {
        if (null === $this->prefixes) {
            $this->collection->addPrefix($this->route->getPath());
        }
        if (null !== $this->host) {
            $this->addHost($this->collection, $this->host);
        }

        $this->parent->addCollection($this->collection);
    }

    /** * Creates a sub-collection. */
    final public function collection(string $name = ''): self
    {
        return new self($this->collection, $this->name.$name$this$this->prefixes);
    }


        $routes = $this->createLocalizedRoute($collection$id$paths ?: $node->getAttribute('path'));
        $routes->addDefaults($defaults);
        $routes->addRequirements($requirements);
        $routes->addOptions($options);
        $routes->setSchemes($schemes);
        $routes->setMethods($methods);
        $routes->setCondition($condition);

        if (null !== $hosts) {
            $this->addHost($routes$hosts);
        }
    }

    /** * Parses an import and adds the routes in the resource to the RouteCollection. * * @return void * * @throws \InvalidArgumentException When the XML is invalid */
    protected function parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file)
    {


        $routes = $this->createLocalizedRoute($collection$id$paths ?: $node->getAttribute('path'));
        $routes->addDefaults($defaults);
        $routes->addRequirements($requirements);
        $routes->addOptions($options);
        $routes->setSchemes($schemes);
        $routes->setMethods($methods);
        $routes->setCondition($condition);

        if (null !== $hosts) {
            $this->addHost($routes$hosts);
        }
    }

    /** * Parses an import and adds the routes in the resource to the RouteCollection. * * @return void * * @throws \InvalidArgumentException When the XML is invalid */
    protected function parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file)
    {


    /** * Sets the host to use for all child routes. * * @param string|array $host the host, or the localized hosts * * @return $this */
    final public function host(string|array $host)static
    {
        $this->addHost($this->route, $host);

        return $this;
    }
}
Home | Imprint | This part of the site doesn't use cookies.