-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WCM] Revamped the Quick Start tutorial #4374
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
Changes from 1 commit
531fc24
4725c16
fe20efd
1ca388e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ a single ``Bundle`` class that describes it:: | |
|
||
In addition to the AppBundle that was already talked about, notice that the | ||
kernel also enables other bundles such as the FrameworkBundle, DoctrineBundle, | ||
SwiftmailerBundle and AsseticBundle bundle. They are all part of the core framework. | ||
SwiftmailerBundle and AsseticBundle. They are all part of the core framework. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technically, they are not. FrameworkBundle, TwigBundle, SecurityBundle, WebProfilerBundle and DebugBundle are the only bundles being in the core framework: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. part of the standard distribution. Only 2 of them are part of the core framework. |
||
|
||
Configuring a Bundle | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -213,7 +213,7 @@ the location of the AppBundle. | |
Logical Controller Names | ||
........................ | ||
|
||
For controllers, you need to reference action using the format | ||
For controllers, you need to reference actions using the format | ||
``BUNDLE_NAME:CONTROLLER_NAME:ACTION_NAME``. For instance, | ||
``AppBundle:Default:index`` maps to the ``indexAction`` method from the | ||
``AppBundle\Controller\DefaultController`` class. | ||
|
@@ -240,7 +240,7 @@ Using Vendors | |
Odds are that your application will depend on third-party libraries. Those | ||
should be stored in the ``vendor/`` directory and managed by Composer. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [...] and are managed by Composer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your proposal is better, but I think it doesn't convey the meaning that I was thinking of. It's not only that Composer manages There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just: "should be stored in the |
||
This directory already contains the Symfony libraries, the SwiftMailer library, | ||
the Doctrine ORM, the Twig templating system, and some other third party | ||
the Doctrine ORM, the Twig templating system and some other third party | ||
libraries and bundles. | ||
|
||
Understanding the Cache and Logs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ to display the installed PHP version: | |
|
||
.. code-block:: bash | ||
|
||
php --version | ||
$ php --version | ||
|
||
.. _installing-symfony2: | ||
|
||
|
@@ -37,12 +37,13 @@ On **Linux** and **Mac OS X** systems, execute the following console commands: | |
|
||
.. note:: | ||
|
||
If your system doesn't have cURL installed, execute instead the following | ||
command: | ||
If your system doesn't have cURL installed, execute the following | ||
commands instead: | ||
|
||
.. code-block:: bash | ||
|
||
$ php -r "readfile('https://symfony.com/installer');" | php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add the |
||
$ sudo mv symfony.phar /usr/local/bin/symfony | ||
|
||
After installing the Symfony installer, you'll have to open a new console window | ||
to be able to execute the new ``symfony`` command: | ||
|
@@ -214,16 +215,17 @@ A **PHP annotation** is a convenient way to configure a method without having to | |
write regular PHP code. Beware that annotation blocks start with ``/**``, whereas | ||
regular PHP comments start with ``/*``. | ||
|
||
The first value of ``@Route()`` defines the path that will trigger the execution | ||
of the action. This path is configured via a relative URL, so you don't have to | ||
add the host of your application (e.g. ```http://example.com``). In this case, | ||
the value ``/`` refers to the application homepage. The second value of ``@Route()`` | ||
(e.g. ``name="homepage"``) is optional and sets the name of this route. For now | ||
this name is not needed, but later it'll be useful for linking pages. | ||
The first value of ``@Route()`` defines the URL that will trigger the execution | ||
of the action. As you don't have to add the host of your application to the URL | ||
(e.g. ```http://example.com``), these URLs are always relative and they are usually | ||
called *paths*. In this case, the ``/`` path refers to the application homepage. | ||
The second value of ``@Route()`` (e.g. ``name="homepage"``) is optional and sets | ||
the name of this route. For now this name is not needed, but later it'll be useful | ||
for linking pages. | ||
|
||
Considering all this, the ``@Route("/", name="homepage")`` annotation creates a | ||
new route called ``homepage`` which makes Symfony execute the ``index`` action | ||
of the ``Default`` controller when the users browses the ``/`` URL of the application. | ||
of the ``Default`` controller when the user browses the ``/`` path of the application. | ||
|
||
.. tip:: | ||
|
||
|
@@ -259,7 +261,7 @@ the following code: | |
{% endblock %} | ||
|
||
This template is created with `Twig`_, a new template engine created for modern | ||
PHP applications. The :doc:`second part of this tutorial</quick_tour/the_view>` | ||
PHP applications. The :doc:`second part of this tutorial </quick_tour/the_view>` | ||
will introduce how templates work in Symfony. | ||
|
||
.. _quick-tour-big-picture-environments: | ||
|
@@ -287,8 +289,8 @@ may be worried about your visitors accessing sensible information. Symfony is | |
aware of this issue and for that reason, it won't display this bar when your | ||
application is running in the production server. | ||
|
||
How does Symfony knows when is your application running locally or in a production | ||
server? Keep reading to discover the concept of **execution environments**. | ||
How does Symfony know whether your application is running locally or on a | ||
production server? Keep reading to discover the concept of **execution environments**. | ||
|
||
.. _quick-tour-big-picture-environments-intro: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ Below is a minimal template that illustrates a few basics, using two variables | |
|
||
To render a template in Symfony, use the ``render`` method from within a controller. | ||
If the template needs variables to generate its contents, pass them as an array | ||
using the second optional second argument:: | ||
using the second optional argument:: | ||
|
||
$this->render('default/index.html.twig', array( | ||
'variable_name' => 'variable_value', | ||
|
@@ -156,7 +156,7 @@ The best way to share a snippet of code between several templates is to create a | |
new template fragment that can then be included from other templates. | ||
|
||
Imagine that we want to display ads on some pages of our application. First, | ||
create an ``banner.html.twig`` template: | ||
create a ``banner.html.twig`` template: | ||
|
||
.. code-block:: jinja | ||
|
||
|
@@ -229,8 +229,8 @@ updated by just changing the configuration: | |
|
||
<a href="{{ path('homepage') }}">Return to homepage</a> | ||
|
||
The ``path`` function takes the route name as the first argument and optionally | ||
you can pass an array of route parameters as the second argument. | ||
The ``path`` function takes the route name as the first argument and you can | ||
optionally pass an array of route parameters as the second argument. | ||
|
||
.. tip:: | ||
|
||
|
@@ -251,8 +251,8 @@ Symfony provides the ``asset`` function to deal with them easily: | |
<img src="{{ asset('images/logo.png') }}" /> | ||
|
||
The ``asset()`` function looks for the web assets inside the ``web/`` directory. | ||
If you store them in other directory, read ..... this article to learn how to | ||
manage web assets. | ||
If you store them in another directory, read :doc:`this article <cookbook/assetic/asset_management>` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. starting slash is missing |
||
to learn how to manage web assets. | ||
|
||
Using the ``asset`` function, your application is more portable. The reason is | ||
that you can move the application root directory anywhere under your web root | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the
the
before the bundle names ?