8000 [4.0] Setup & Page Creation updates by weaverryan · Pull Request #8544 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[4.0] Setup & Page Creation updates #8544

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 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changes thanks to Javier
  • Loading branch information
weaverryan committed Oct 29, 2017
commit 5cd1e20f8415b3e82d9b8c0a03875de93471f067
21 changes: 12 additions & 9 deletions page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ random) number and prints it. To do that, create a "Controller class" and a
}
}

To map a URL to this controller, create a route in ``config/routes.yaml``:
Now you need to associate this controller function with a public URL (e.g. ``/lucky/number``)
so that the ``number()`` method is executed when a user browses to it. This association
is defined by creating a **route** in the ``config/routes.yaml`` file:

.. code-block:: yml

Expand Down Expand Up @@ -106,7 +108,7 @@ the annotation route import at the bottom:
resource: ../src/Controller/
type: annotation

After this one-time setup, you can nowadd your route directly *above* the controller:
After this one-time setup, you can now add your route directly *above* the controller:

.. code-block:: diff

Expand Down Expand Up @@ -139,11 +141,12 @@ special things happened, both thanks to a powerful Composer plugin called
First, ``annotations`` isn't a real package name: it's an *alias* (i.e. shortcut)
that Flex resolves to ``sensio/framework-extra-bundle``.

Second, after this package was downloaded, Flex executed a *recipe*, which automatically
enabled the bundle. Flex recipes exist for many packages (not just bundles) and have
have the ability to do a lot, like adding configuration files, creating directories,
updating ``.gitignore`` and adding new config to your ``.env`` file. Flex *automates*
the installation of packages so you can get back to coding.
Second, after this package was downloaded, Flex executed a *recipe*, which is a
set of automated instructions that tell Symfony how to integrate an external
package. Flex recipes exist for many packages (not just bundles) and have the
Copy link
Member

Choose a reason for hiding this comment

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

One last comment on my side. In this paragraph we mention "bundles" for the first time and without prior introduction ("[...] Flex recipes exist for many packages (not just bundles) and have [...]"). Given that bundles are not important in this article, we could remove this mention. Thanks!

ability to do a lot, like adding configuration files, creating directories,
updating ``.gitignore`` and adding new config to your ``.env`` file. Flex
*automates* the installation of packages so you can get back to coding.

You can learn more about Flex by reading ":doc:`/setup/flex`". But that's not necessary:
Flex works automatically in the background when you add packages.
8000 Copy link
Member

Choose a reason for hiding this comment

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

This is probably the time to link to http://symfony.sh ?

Expand Down Expand Up @@ -239,7 +242,7 @@ variable so you can use it in Twig::
}
}

Template files live in the ``templates/`` directory, which was created for your automatically
Template files live in the ``templates/`` directory, which was created for you automatically
when you installed Twig. Create a new ``templates/lucky`` directory with a new
``number.html.twig`` file inside:

Expand All @@ -265,7 +268,7 @@ project:

``config/``
Contains... configuration of course!. You will configure routes, :doc:`services </service_container>`
and pckages.
and packages.

``src/``
All your PHP code lives here.
Expand Down
2 changes: 1 addition & 1 deletion s 86D2 etup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Setting up an Existing Symfony Project
--------------------------------------

If you're working on an existing Symfony application, you'll just need to do a few
things to get your project setup. Assuming your team uses git, you can setup your
things to get your project setup. Assuming your team uses Git, you can setup your
project with the following commands:

.. code-block:: terminal
Expand Down
0