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

Update hostname_pattern.rst #7663

Closed
wants to merge 1 commit into from
Closed

Update hostname_pattern.rst #7663

wants to merge 1 commit into from

Conversation

krlove
Copy link
Contributor

@krlove krlove commented Mar 21, 2017

Symfony\Component\Routing\RouteCollection::addCollection accepts one argument of type RouteCollection that is why
$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com'); is not correct.

`Symfony\Component\Routing\RouteCollection::addCollection` accepts one argument on type `RouteCollection` that is why
`$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');` is not correct.
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

Good catch! Should be merged in 2.7.

$collection = new RouteCollection();
$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');
$collection->addCollection($importedCollection);
Copy link
Member

Choose a reason for hiding this comment

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

I think we don't need to wrap the imported collection in another collection, but can do the following instead (we can then remove the use statement too):

$collection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php");
$collection->setHost('hello.example.com');

return $collection;

@xabbuh
Copy link
Member

xabbuh commented Apr 8, 2017

Thank you @krlove.

xabbuh added a commit that referenced this pull request Apr 8, 2017
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7663).

Discussion
----------

Update hostname_pattern.rst

`Symfony\Component\Routing\RouteCollection::addCollection` accepts one argument of type `RouteCollection` that is why
`$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');` is not correct.

Commits
-------

71dd533 Update hostname_pattern.rst
xabbuh added a commit that referenced this pull request Apr 8, 2017
@xabbuh xabbuh closed this Apr 8, 2017
xabbuh added a commit that referenced this pull request Apr 9, 2017
* 2.7: (48 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  Fix trusted hosts example regular expressions
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
xabbuh added a commit that referenced this pull request Apr 13, 2017
* 2.8: (48 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  Fix trusted hosts example regular expressions
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
xabbuh added a commit that referenced this pull request Apr 13, 2017
* 3.2: (60 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  typo fix
  Fix trusted hosts example regular expressions
  add reference built in listener for kernel.response event in >=3.1
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants