Skip to content

hostname_pattern not working #6821

@MichaelHindley

Description

@MichaelHindley

Trying to use hostname_pattern as per http://symfony.com/doc/master/components/routing/hostname_pattern.html

like this:
routing.yml

#Bike
bike:
    prefix: /
    pattern: /
    hostname_pattern: *.cykelverkstad.nu
    defaults: { _controller: EmpireBikeBundle:Homepage:index }

using this composer.json require:

{
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.2.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*",
        "jms/serializer-bundle": "0.9",
        "friendsofsymfony/rest-bundle": "0.10.0"
    },
}

Debug-bar shows symfony as 2.2.

Getting this error:
[InvalidArgumentException]
The routing file "D:/Dev/wamp/www/empire/app/config\routing.yml" contains u
nsupported keys for "bike": "hostname_pattern". Expected one of: "resource"
, "type", "prefix", "pattern", "path", "hostname", "schemes", "methods", "d
efaults", "requirements", "options".

It says "hostname_pattern" is a unsupported key, even though Symfony is on 2.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions