Skip to content

Added php opening tag to sample controller #11151

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Krap
Copy link
Contributor

@Krap Krap commented Mar 13, 2019

It took me a while to figure out why the sample didn't seem to work, despite being experimented in php ; i checked many times namespace, uses and class declaration before finding that i just missed the opening tag. Think it would help others (even more if unexperimented) discovering symfony by copy/pasting sample code from the doc !

It took me a while to figure out why the sample didn't seem to work, despite being experimented in php ; i checked many times namespace, uses and class declaration before finding that i just missed the opening tag. Think it would help others (even more if unexperimented) discovering symfony by copy/pasting sample code from the doc !
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. I am against 👎 this change, because on no other place, except if php and html is mixed, we added an php open tag

@Krap
Copy link
Contributor Author

Krap commented Mar 14, 2019 via email

@javiereguiluz javiereguiluz added this to the 3.4 milestone Mar 14, 2019
javiereguiluz added a commit that referenced this pull request Mar 14, 2019
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes #11151).

Discussion
----------

Added php opening tag to sample controller

It took me a while to figure out why the sample didn't seem to work, despite being experimented in php ; i checked many times namespace, uses and class declaration before finding that i just missed the opening tag. Think it would help others (even more if unexperimented) discovering symfony by copy/pasting sample code from the doc !

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

4c3a0d0 Added php opening tag to sample controller
@javiereguiluz
Copy link
Member

@OskarStark you are right and we never add the <?php to any code sample. However, this example is super critical. This article is what the "Welcome to Symfony" page links to ... so this is the very first Symfony example to lots of people, and it can't fail for them.

In the past we received lots of complaints about this and refused to do the change. But one day we decided it's better if we listen to newcomers about this article. We added this <?php but I think it was lost somehow in some merge. So, let's readd it (but only for this example, not for others!!).

@Krap thanks for your contribution!

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