Skip to content
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

Merged
merged 1 commit into from Nov 22, 2012
Merged

Conversation

arnaud-lb
Copy link
Contributor

This adds documentation for symfony/symfony#3378

@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vicb
Copy link
Contributor

vicb commented Nov 12, 2012

👍

.. versionadded:: 2.2
Hostname matching support was added in Symfony 2.2

You can also match on the HTTP *hostname* of the incomming request:
Copy link
Contributor

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

@alvarezmario
Copy link
Contributor

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%
Copy link
Member

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

weaverryan added a commit that referenced this pull request Nov 22, 2012
[Routing] added hostname pattern
@weaverryan weaverryan merged commit 856369b into symfony:master Nov 22, 2012
weaverryan added a commit that referenced this pull request Nov 22, 2012
@weaverryan
Copy link
Member

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!

@arnaud-lb
Copy link
Contributor Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants