New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Routing] added hostname pattern #1894
Conversation
@@ -692,6 +692,120 @@ form via the same URL, while using distinct controllers for the two actions. | |||
Like the other requirements, the ``_method`` requirement is parsed as a regular | |||
expression. To match ``GET`` *or* ``POST`` requests, you can use ``GET|POST``. | |||
|
|||
Adding a Hostname Pattern | |||
~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arnaud-lb You must specified that this feature is new in Symfony2.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
👍 |
.. versionadded:: 2.2 | ||
Hostname matching support was added in Symfony 2.2 | ||
|
||
You can also match on the HTTP *hostname* of the incomming request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: incomming
should be incoming
Is there something I need to setup in the .htaccess for this to work? My browser is lost and cannot find the url. |
hostname_pattern: m.{domain} | ||
defaults: { _controller: AcmeDemoBundle:Main:mobileHomepage } | ||
requirements: | ||
domain: %domain% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%domain% is not defined anywhere, nor explained that it would be replaced by a container param
[Routing] added hostname pattern
…book" article with inter-links
Hi Arnaud! Very nice PR! I've merged it in, but also refactored the majority of the new documentation into a new entry inside the routing component (with links to this article). Please let me know if you see any errors or want to make any changes! Thanks! |
Great, thanks! |
This adds documentation for symfony/symfony#3378