Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d69414

Browse files
committed
Updating 'Exploring the Project'
1 parent6b5c977 commit0d69414

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

‎book/bundles.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Now that you've created the bundle, enable it via the ``AppKernel`` class::
107107
{
108108
$bundles = array(
109109
// ...
110+
110111
// register your bundle
111112
new Acme\TestBundle\AcmeTestBundle(),
112113
);

‎book/page_creation.rst

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ Suppose you want to create a JSON endpoint that returns the lucky number.
102102
Just add a second method to ``LuckyController``::
103103

104104
// src/AppBundle/Controller/LuckyController.php
105-
// ...
106105

106+
// ...
107107
class LuckyController extends Controller
108108
{
109109
// ...
@@ -132,8 +132,8 @@ Try this out in your browser:
132132
You can even shorten this with the handy:class:`Symfony\\Component\\HttpFoundation\\JsonResponse`::
133133

134134
// src/AppBundle/Controller/LuckyController.php
135-
// ...
136135

136+
// ...
137137
// --> don't forget this new use statement
138138
use Symfony\Component\HttpFoundation\JsonResponse;
139139

@@ -168,8 +168,8 @@ at the end:
168168
..code-block::php-annotations
169169
170170
// src/AppBundle/Controller/LuckyController.php
171-
// ...
172171
172+
// ...
173173
class LuckyController extends Controller
174174
{
175175
/**
@@ -192,7 +192,7 @@ at the end:
192192
193193
..code-block::xml
194194
195-
<!--src/Acme/DemoBundle/Resources/config/routing.xml-->
195+
<!--app/config/routing.xml-->
196196
<?xml version="1.0" encoding="UTF-8" ?>
197197
<routesxmlns="http://symfony.com/schema/routing"
198198
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -206,7 +206,7 @@ at the end:
206206
207207
..code-block::php
208208
209-
//src/Acme/DemoBundle/Resources/config/routing.php
209+
//app/config/routing.php
210210
use Symfony\Component\Routing\RouteCollection;
211211
use Symfony\Component\Routing\Route;
212212
@@ -274,8 +274,8 @@ to use Twig - or many other tools in Symfony - is to extend Symfony's base
274274
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller` class::
275275

276276
// src/AppBundle/Controller/LuckyController.php
277-
// ...
278277

278+
// ...
279279
// --> add this new use statement
280280
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
281281

@@ -296,8 +296,8 @@ Twig templates, another that can log messages and many more.
296296
To render a Twig template, use a service called ``templating``::
297297

298298
// src/AppBundle/Controller/LuckyController.php
299-
// ...
300299

300+
// ...
301301
class LuckyController extends Controller
302302
{
303303
/**
@@ -329,8 +329,8 @@ But this can get even easier! By extending the ``Controller`` class, you
329329
also get a lot of shortcut methods, like ``render()``::
330330

331331
// src/AppBundle/Controller/LuckyController.php
332-
// ...
333332

333+
// ...
334334
/**
335335
* @Route("/lucky/number/{count}")
336336
*/
@@ -434,30 +434,41 @@ worked inside the two most important directories:
434434
else). As you get more advanced, you'll learn what can be done inside each
435435
of these.
436436

437-
The ``app/`` directory also holds a few other things, like the cache directory
438-
``app/cache/``, the logs directory ``app/logs/`` and ``app/AppKernel.php``,
439-
which you'll use to enable new bundles (and one of a *very* short list of
437+
The ``app/`` directory also holds some other things, like ``app/AppKernel.php``,
438+
which you'll use to enable new bundles (this is one of a *very* short list of
440439
PHP files in ``app/``).
441440

442441
The ``src/`` directory has just one directory - ``src/AppBundle`` -
443442
and everything lives inside of it. A bundle is like a "plugin" and you can
444443
`find open source bundles`_ and install them into your project. But even
445-
*your* code lives in a bundle - typically``AppBundle`` (though there's
446-
nothing special about``AppBundle``). To find out more about bundles and
444+
*your* code lives in a bundle - typically*AppBundle* (though there's
445+
nothing special about AppBundle). To find out more about bundles and
447446
why you might create multiple bundles (hint: sharing code between projects),
448447
see the:doc:`Bundles</book/bundles>` chapter.
449448

450449
So what about the other directories in the project?
451450

452-
``vendor/``
453-
Vendor (i.e. third-party) libraries and bundles are downloaded here by
454-
the `Composer`_ package manager.
455-
456451
``web/``
457452
This is the document root for the project and contains any publicly accessible
458453
files, like CSS, images and the Symfony front controllers that execute
459454
the app (``app_dev.php`` and ``app.php``).
460455

456+
``tests/``
457+
The automatic tests (e.g. Unit tests) of your application live here.
458+
459+
``bin/``
460+
The "binary" files live here. The most important one is the ``console``
461+
file which is used to execute Symfony commands via the console.
462+
463+
``var/``
464+
This is were automatically created files are stored, like cache files
465+
(``var/cache/``) and logs (``var/logs/``).
466+
467+
``vendor/``
468+
Vendor (i.e. third-party) libraries and bundles are downloaded here by
469+
the `Composer`_ package manager. You should never need to manually edit
470+
something in this directory.
471+
461472
..seealso::
462473

463474
Symfony is flexible. If you need to, you can easily override the default
@@ -475,8 +486,8 @@ is ``app/config/config.yml``:
475486
..code-block::yaml
476487
477488
# app/config/config.yml
478-
# ...
479489
490+
# ...
480491
framework:
481492
secret:"%secret%"
482493
router:
@@ -548,7 +559,7 @@ use the handy ``bin/console`` command:
548559

549560
..code-block::bash
550561
551-
$ bin/console config:dump-reference framework
562+
$phpbin/console config:dump-reference framework
552563
553564
There's a lot more power behind Symfony's configuration system, including
554565
environments, imports and parameters. To learn all of it, see the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp