Skip to content

Added php start tag to page_creation.rst #5741

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

Conversation

PhoneixS
Copy link

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets

I have added the php start tag <?php to the code fragments of the file src/AppBundle/Controller/LuckyController.php as newcomers can forget it.

I have added the php start tag `<?php` to the code fragments of the file `src/AppBundle/Controller/LuckyController.php` as newcomers can forget it.
@javiereguiluz
Copy link
Member

@PhoneixS thanks for proposing this improvement.

Although it's true that for a newcomer this may be useful, right now in the Symfony docs we never use the opening PHP tag (except when explaining the PHP templates vs Twig templates and in the chapter dedicated to newcomers: http://symfony.com/doc/current/book/from_flat_php_to_symfony2.html). I think we should keep using this convention, but let's wait and see what do doc managers think about this idea.

@PhoneixS
Copy link
Author

PhoneixS commented Oct 5, 2015

Maybe is better to add a note about it instead of adding the start tag.

@xabbuh
Copy link
Member

xabbuh commented Oct 5, 2015

I am 👎 on this too (I am sure we discussed that some time ago but I cannot find that PR again).

In my opinion, PHP developers know that they have to use the opening tag and thus we do not need to clutter our examples with it. We could add a note somewhere, though what would be the best place for it?

@wouterj
Copy link
Member

wouterj commented Oct 5, 2015

This has been discussed within the doc team a couple of times (Can't find the PR/issue either) and I'm 👎 too.

There are a couple reasons to not use these start tags:

  • The PHP start tag is a very basic PHP thing. People working with Symfony should already have a certain knowledge of the PHP language, so 100% change they know the PHP start tag is needed. When it's forgotten, it's also pretty easy to find out.
  • It breaks the PHP code highlighter, meaning we have to change every code example to use html+php
  • It makes all code examples 2 lines longer, which isn't worth it considering (1).
  • If we are going to change it, we have to change it for all PHP code examples. After merging this PR, things would be very consistent, resulting in probably even more errors.

As 3 doc team contributors have voted -1, I'm going to close this PR. This doesn't mean we don't like the effort you put in trying to make the docs better (we love it!), I hope to see you back with a PR that we can merge!

If you still feel like it's a better idea to add the PHP start tag, feel free to comment after closure. There always is a reopen button :)

@wouterj wouterj closed this Oct 5, 2015
@PhoneixS
Copy link
Author

PhoneixS commented Oct 8, 2015

You have convinced me. What about adding a note about it?

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.

4 participants