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

Remove dash prefix from route name #7027

Merged
merged 1 commit into from
Oct 6, 2016
Merged

Conversation

bocharsky-bw
Copy link
Contributor

Actually, in most cases, the _ prefix means something internal and probably better to avoid using it in examples

Actually, in most cases, the `_` prefix means something internal and probably better to avoid using it in examples
@snoek09
Copy link

snoek09 commented Oct 3, 2016

AFAIK it's a naming convention.
If this is changed here I feel it should be changed throughout the whole documentation.
This will avoid confusion.

Status: needs work.

@bocharsky-bw
Copy link
Contributor Author

Yes, it's a naming convention for something internal, e.g. framework routes, etc. But I think a user should avoid using it, shouldn't it?

Could anyone provide a link where this naming convention are explained here in docs?

@javiereguiluz
Copy link
Member

I think @bocharsky-bw is right here. The leading _ looks very wrong for doc examples ... but maybe I'm missing something here.

@wouterj
Copy link
Member

wouterj commented Oct 3, 2016

A _ means "private" in languages like JavaScript and is used throughout the Symfony code base for special Symfony keys. This avoids possible conflicts. (e.g. the _controller request attribute).

I personally also use the _ prefix when loading routing resources, but that's also not the case here.

So indeed, 👍 for removing the underscore prefix.

👍
status: reviewed

@xabbuh
Copy link
Member

xabbuh commented Oct 5, 2016

Why do we actually not use app.welcome here?

@bocharsky-bw
Copy link
Contributor Author

Good question! Actually, I don't see any prefixes in Symfony Best Practices for controllers. That's why I left this route name as simple as possible.

@javiereguiluz
Copy link
Member

@bocharsky-bw I agree with you. We never recommend to add prefix to route names. We do that because unlike services (where Symfony creates dozes of them) there are almost no built-in routes, so all/most of them belong to your application.

@wouterj
Copy link
Member

wouterj commented Oct 6, 2016

Yet another nice PR, thanks Victor for your work!

@wouterj wouterj merged commit b547804 into symfony:2.7 Oct 6, 2016
wouterj added a commit that referenced this pull request Oct 6, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

Remove dash prefix from route name

Actually, in most cases, the `_` prefix means something internal and probably better to avoid using it in examples

Commits
-------

b547804 Remove dash prefix from route name
@bocharsky-bw bocharsky-bw deleted the patch-6 branch October 7, 2016 08:11
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.

6 participants