Skip to content
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

Remove app_dev as build-in server is used #6239

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 10 additions & 4 deletions book/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ format you prefer:

.. note::

You'll learn exactly how to load each file/format in the next section
`Environments`_.
You'll learn exactly how to load each file/format in the next section
`Environments`_.

Each top-level entry like ``framework`` or ``twig`` defines the configuration
for a particular bundle. For example, the ``framework`` key defines the configuration
Expand Down Expand Up @@ -122,13 +122,13 @@ FrameworkBundle configuration:

.. code-block:: bash

$ app/console config:dump-reference FrameworkBundle
$ php app/console config:dump-reference FrameworkBundle

The extension alias (configuration key) can also be used:

.. code-block:: bash

$ app/console config:dump-reference framework
$ php app/console config:dump-reference framework

.. note::

Expand Down Expand Up @@ -195,6 +195,12 @@ cached files and allow them to rebuild:
be accessed directly through the browser. See the :doc:`testing chapter </book/testing>`
for more details.

.. tip::

When using the ``server:run`` command to start a server,
``http://localhost:8000/`` will use the dev front controller of your
application.

.. index::
single: Environments; Configuration

Expand Down
21 changes: 6 additions & 15 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ a method inside of it that will be executed when someone goes to ``/lucky/number

Before diving into this, test it out!

http://localhost:8000/app_dev.php/lucky/number
http://localhost:8000/lucky/number

.. tip::

If you setup a proper virtual host in :doc:`Apache or Nginx </cookbook/configuration/web_server_configuration>`,
If you setup a proper virtual host in
:doc:`Apache or Nginx </cookbook/configuration/web_server_configuration>`,
replace ``http://localhost:8000`` with your host name - like
``http://symfony.dev/app_dev.php/lucky/number``.

Expand All @@ -80,16 +81,6 @@ and is where you build the page. The only rule is that a controller *must*
return a Symfony :ref:`Response <component-http-foundation-response>` object
(and you'll even learn to bend this rule eventually).

.. sidebar:: What's the ``app_dev.php`` in the URL?

Great question! By including ``app_dev.php`` in the URL, you're executing
Symfony through a file - ``web/app_dev.php`` - that boots it in the ``dev``
environment. This enables great debugging tools and rebuilds cached
files automatically. For production, you'll use clean URLs - like
``http://localhost:8000/lucky/number`` - that execute a different file -
``app.php`` - that's optimized for speed. To learn more about this and
environments, see :ref:`book-page-creation-prod-cache-clear`.

Creating a JSON Response
~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -126,7 +117,7 @@ Just add a second method to ``LuckyController``::

Try this out in your browser:

http://localhost:8000/app_dev.php/api/lucky/number
http://localhost:8000/api/lucky/number

You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundation\\JsonResponse`::

Expand Down Expand Up @@ -247,7 +238,7 @@ The best part is that you can access this value and use it in your controller::

Try it by going to ``/lucky/number/XX`` - replacing XX with *any* number:

http://localhost:8000/app_dev.php/lucky/number/7
http://localhost:8000/lucky/number/7

You should see *7* lucky numbers printed out! You can get the value of any
``{placeholder}`` in your route by adding a ``$placeholder`` argument to
Expand Down Expand Up @@ -404,7 +395,7 @@ to put the content into the middle of the ``base.html.twig`` layout.

Refresh to see your template in action!

http://localhost:8000/app_dev.php/lucky/number/9
http://localhost:8000/lucky/number/9

If you view the source code, you now have a basic HTML structure thanks to
``base.html.twig``.
Expand Down