Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Components][Routing] Fix addPrefix() sample code#3622

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.3frombicpi:fix_route_collection_sample_code
Mar 12, 2014
Merged

[Components][Routing] Fix addPrefix() sample code#3622

weaverryan merged 1 commit intosymfony:2.3frombicpi:fix_route_collection_sample_code
Mar 12, 2014

Conversation

bicpi
Copy link
Contributor

QA
Doc fix?yes
New docs?no
Applies toall
Fixed tickets-

The sample code used for demonstrating the
Symfony\Component\Routing\RouteCollection::addPrefix() method did not match the signature. I've updated the code to show the provided features when adding a nested route collection. + some minor fixes along the way.

->addOptions(array(...))
->setHost('admin.example.com')
->setMethods(array('POST'))
->setSchemes(array('https'));
Copy link
Member

Choose a reason for hiding this comment

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

You're absolutely right about the wrong arguments toaddPrefix, but I don't think the methods can be chained like this - it looks like they all returnnull:https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/RouteCollection.php#L149

@bicpi
Copy link
ContributorAuthor

@weaverryan Oh, thanks for verifying this fix, can't remember how that fluid usage slipped in... ;-)

But I've found another issue: Theversionadded note below theaddPrefix() example says that theaddPrefix() method was added in Symfony 2.2. Mh, actually I foud that it existed since Symfony 2.0 and it was possible to add a prefix with this method or theaddCollection() method. Currently I've removed this note in this PR, because listing all the methods that were new to 2.2 and then to 2.3 ()host, schemes, method etc.) did not seem to be a good option. What do you think?

@weaverryan
Copy link
Member

I agree and like how you handled it :). Thanks as always Philipp

weaverryan added a commit that referenced this pull requestMar 12, 2014
This PR was merged into the 2.3 branch.Discussion----------[Components][Routing] Fix addPrefix() sample code| Q             | A| ------------- | ---| Doc fix?      | yes| New docs?     | no| Applies to    | all| Fixed tickets | -The sample code used for demonstrating the[`Symfony\Component\Routing\RouteCollection::addPrefix()`](http://api.symfony.com/2.3/Symfony/Component/Routing/RouteCollection.html#method_addPrefix) method did not match the signature. I've updated the code to show the provided features when adding a nested route collection. + some minor fixes along the way.Commits-------e095c13 [Components][Routing] Fix addPrefix() sample code
@weaverryanweaverryan merged commite095c13 intosymfony:2.3Mar 12, 2014
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bicpi@weaverryan

[8]ページ先頭

©2009-2025 Movatter.jp