-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Missing <?php
tags?
#46
Comments
The examples most skip the initial PHP declaring marker as they assume you
already are in PHP scope: are there specific examples where this is
particularly unclear?
…On Mon, May 17, 2021, 03:39 RussellAult ***@***.***> wrote:
I'm not experience enough with PHP to know the source of the issue, but
I've been working my way through the tutorial and when I got to the "try it
out!" step at the end of "Database and Models" the contents of my PHP files
were being displayed verbatim. I had to go back through and add <?php to
the beginning of the all the .php files I had created, and now everything
works. For what it's worth I'm using Apache as the server.
Did I miss something in the tutorial that would cover this? Do not all web
servers require a PHP tag at the beginning of the file anymore?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#46>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEEBGOVCST74AZ35MFDTOBXU7ANCNFSM447PLK7Q>
.
|
@Ocramius Perhaps I'm not the target audience, but the last time I did anything that might be called "web development" was before application frameworks were a thing, so when an instruction says "Let's create that file now, with the following contents:" I follow those instructions verbatim. So, at a minimum, every time the entire contents of a particular file except for the Is there an advantage to omitting the |
Also, part of my confusion stems from the fact that sometimes (like with .phtml files) the |
Generally yes, as examples are very often isolated to code fragments, rather than entire files. We also don't include things like the current namespace, or all the imports, since docs are for reference, not copy-pasteable code in most cases. For Other libraries/tools in the PHP ecosystem also omit the opening |
I think that makes a lot of sense for the fragments. For me, the confusion stems from the fact that, unlike with most documentation, several of the examples in the tutorial imply that they are the entire contents of a given file (i.e. I think it's confusing when every line of a file is shown except for the first one). |
The target group are experienced PHP programmers because it is not the task of the documentation to explain the basics. Unfortunately, this would go beyond any capacities. But the current plan already includes this topic and we will provide the full code and add links in the documentation. But before that, we will rework the tutorial. |
I'm not experience enough with PHP to know the source of the issue, but I've been working my way through the tutorial and when I got to the "try it out!" step at the end of "Database and Models" the contents of my PHP files were being displayed verbatim. I had to go back through and add
<?php
to the beginning of the all the .php files I had created, and now everything works. For what it's worth I'm using Apache as the server.Did I miss something in the tutorial that would cover this? Do not all web servers require a PHP tag at the beginning of the file anymore?
The text was updated successfully, but these errors were encountered: