File tree Expand file tree Collapse file tree 13 files changed +196
-189
lines changed
Filter options
Expand file tree Collapse file tree 13 files changed +196
-189
lines changed
Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ to create files and execute the following commands:
35
35
c:\> cd projects/
36
36
c:\p rojects\> php symfony new blog
37
37
38
+ .. note ::
39
+
40
+ If the installer doesn't work for you or doesn't output anything, make sure
41
+ that the `Phar extension `_ is installed and enabled on your computer.
42
+
38
43
This command creates a new directory called ``blog `` that contains a fresh new
39
44
project based on the most recent stable Symfony version available. In addition,
40
45
the installer checks if your system meets the technical requirements to execute
@@ -178,3 +183,4 @@ the Symfony directory structure.
178
183
.. _`Composer download page` : https://getcomposer.org/download/
179
184
.. _`public checksums repository` : https://github.com/sensiolabs/checksums
180
185
.. _`these steps` : http://fabien.potencier.org/signing-project-releases.html
186
+ .. _`Phar extension` : http://php.net/manual/en/intro.phar.php
Original file line number Diff line number Diff line change @@ -116,8 +116,10 @@ Controllers are also called *actions*.
116
116
117
117
This controller is pretty straightforward:
118
118
119
- * *line 4 *: Symfony takes advantage of PHP's namespace functionality to
120
- namespace the entire controller class. The ``use `` keyword imports the
119
+ * *line 2 *: Symfony takes advantage of PHP's namespace functionality to
120
+ namespace the entire controller class.
121
+
122
+ * *line 4 *: Symfony again takes advantage of PHP's namespace functionality: the ``use `` keyword imports the
121
123
``Response `` class, which the controller must return.
122
124
123
125
* *line 6 *: The class name is the concatenation of a name for the controller
Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ them for you. Here's the same sample application, now built in Symfony::
554
554
{
555
555
$posts = $this->get('doctrine')
556
556
->getManager()
557
- ->createQuery('SELECT p FROM AcmeBlogBundle :Post p')
557
+ ->createQuery('SELECT p FROM AppBundle :Post p')
558
558
->execute();
559
559
560
560
return $this->render('Blog/list.html.php', array('posts' => $posts));
Original file line number Diff line number Diff line change 4
4
5
5
# app/config/services.yml
6
6
services:
7
- my_mailer :
8
- class: Acme\HelloBundle \Mailer
7
+ app.mailer :
8
+ class: AppBundle \Mailer
9
9
arguments: [sendmail]
10
10
11
11
.. code-block:: xml
15
15
<container xmlns="http://symfony.com/schema/dic/services"
16
16
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
17
xsi:schemaLocation="http://symfony.com/schema/dic/services
18
- http://symfony.com/schema/dic/services/services-1.0.xsd"
19
- >
18
+ http://symfony.com/schema/dic/services/services-1.0.xsd">
19
+
20
20
<services>
21
- <service id="my_mailer " class="Acme\HelloBundle \Mailer">
21
+ <service id="app.mailer " class="AppBundle \Mailer">
22
22
<argument>sendmail</argument>
23
23
</service>
24
24
</services>
29
29
// app/config/services.php
30
30
use Symfony\Component\DependencyInjection\Definition;
31
31
32
- $container->setDefinition('my_mailer ', new Definition(
33
- 'Acme\HelloBundle \Mailer',
32
+ $container->setDefinition('app.mailer ', new Definition(
33
+ 'AppBundle \Mailer',
34
34
array('sendmail')
35
35
));
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ to meet those requirements.
83
83
distributing them. If you want to verify the integrity of any Symfony
84
84
version, follow the steps `explained in this post `_.
85
85
86
+ .. note ::
87
+
88
+ If the installer doesn't work for you or doesn't output anything, make sure
89
+ that the `Phar extension `_ is installed and enabled on your computer.
90
+
86
91
Basing your Project on a Specific Symfony Version
87
92
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88
93
@@ -419,3 +424,4 @@ a wide variety of articles about solving specific problems with Symfony.
419
424
.. _`Symfony REST Edition` : https://github.com/gimler/symfony-rest-edition
420
425
.. _`FOSRestBundle` : https://github.com/FriendsOfSymfony/FOSRestBundle
421
426
.. _`Git` : http://git-scm.com/
427
+ .. _`Phar extension` : http://php.net/manual/en/intro.phar.php
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ at the end:
191
191
192
192
.. code-block :: xml
193
193
194
- <!-- src/Acme/DemoBundle/Resources /config/routing.xml -->
194
+ <!-- app /config/routing.xml -->
195
195
<?xml version =" 1.0" encoding =" UTF-8" ?>
196
196
<routes xmlns =" http://symfony.com/schema/routing"
197
197
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
@@ -205,7 +205,7 @@ at the end:
205
205
206
206
.. code-block :: php
207
207
208
- // src/Acme/DemoBundle/Resources /config/routing.php
208
+ // app /config/routing.php
209
209
use Symfony\Component\Routing\RouteCollection;
210
210
use Symfony\Component\Routing\Route;
211
211
Original file line number Diff line number Diff line change @@ -1186,9 +1186,9 @@ Notice that Symfony adds the string ``Controller`` to the class name (``Blog``
1186
1186
=> ``BlogController ``) and ``Action `` to the method name (``show `` => ``showAction ``).
1187
1187
1188
1188
You could also refer to this controller using its fully-qualified class name
1189
- and method: ``AppBundle\Controller\BlogController::showAction ``.
1190
- But if you follow some simple conventions, the logical name is more concise
1191
- and allows more flexibility.
1189
+ and method: ``AppBundle\Controller\BlogController::showAction ``. But if you
1190
+ follow some simple conventions, the logical name is more concise and allows
1191
+ more flexibility.
1192
1192
1193
1193
.. note ::
1194
1194
You can’t perform that action at this time.
0 commit comments