@@ -23,27 +23,16 @@ Each part of the tutorial will detail the packages that it requires (if any) in
23
23
section titled "installation".
24
24
25
25
If you intend to complete the entire tutorial you can save some time by adding
26
- all of the required packages now.
26
+ all of the required packages now:
27
27
28
- .. code-block :: javascript
29
-
30
- {
31
- ...
32
- require: {
33
- ...
34
- " symfony-cmf/routing-auto-bundle" : " ~1.0" ,
35
- " symfony-cmf/menu-bundle" : " ~2.0" ,
36
- " sonata-project/doctrine-phpcr-admin-bundle" : " ~1.2" ,
37
- " symfony-cmf/tree-browser-bundle" : " ~1.1" ,
38
- " doctrine/data-fixtures" : " ~1.0" ,
39
- " symfony-cmf/routing-bundle" : " ~1.3" ,
40
- " symfony-cmf/routing" : " ~1.3"
41
- },
42
- ...
43
- }
28
+ .. code-block :: bash
44
29
45
- Note that each time you modify your ``composer.json `` file you are required to
46
- run ``composer update ``.
30
+ $ composer require symfony-cmf/routing-auto-bundle \
31
+ symfony-cmf/menu-bundle \
32
+ sonata-project/doctrine-phpcr-admin-bundle \
33
+ symfony-cmf/tree-browser-bundle \
34
+ doctrine/data-fixtures \
35
+ symfony-cmf/routing-bundle
47
36
48
37
Initialize the Database
49
38
~~~~~~~~~~~~~~~~~~~~~~~
@@ -80,7 +69,7 @@ Now you can generate the bundle in which you will write most of your code:
80
69
81
70
.. code-block :: bash
82
71
83
- $ php app/console generate:bundle --namespace=Acme/BasicCmsBundle --dir=src --format=yml --no-interaction
72
+ $ php app/console generate:bundle --namespace=AppBundle --dir=src --format=yml --no-interaction
84
73
85
74
The Documents
86
75
.............
@@ -89,8 +78,8 @@ You will create two document classes, one for the pages and one for the posts.
89
78
These two documents share much of the same logic, so you create a ``trait ``
90
79
to reduce code duplication::
91
80
92
- // src/Acme/BasicCmsBundle /Document/ContentTrait.php
93
- namespace Acme\BasicCmsBundle \Document;
81
+ // src/AppBundle /Document/ContentTrait.php
82
+ namespace AppBundle \Document;
94
83
95
84
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
96
85
@@ -168,8 +157,8 @@ to reduce code duplication::
168
157
169
158
The ``Page `` class is therefore nice and simple::
170
159
171
- // src/Acme/BasicCmsBundle /Document/Page.php
172
- namespace Acme\BasicCmsBundle \Document;
160
+ // src/AppBundle /Document/Page.php
161
+ namespace AppBundle \Document;
173
162
174
163
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
175
164
@@ -188,8 +177,8 @@ other documents to hold a reference to the page. The ``Post`` class will also
188
177
be referenceable and in addition will automatically set the date using the
189
178
`pre persist lifecycle event `_ if it has not been explicitly set previously::
190
179
191
- // src/Acme/BasicCmsBundle /Document/Post.php
192
- namespace Acme\BasicCmsBundle \Document;
180
+ // src/AppBundle /Document/Post.php
181
+ namespace AppBundle \Document;
193
182
194
183
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
195
184
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
@@ -246,9 +235,9 @@ configuration:
246
235
247
236
.. code-block :: yaml
248
237
249
- # src/Acme/BasicCmsBundle /Resources/config/services.yml
238
+ # src/AppBundle /Resources/config/services.yml
250
239
services :
251
- acme_basiccms.basic_cms .phpcr.initializer :
240
+ app .phpcr.initializer :
252
241
class : Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer
253
242
arguments :
254
243
- My custom initializer
@@ -259,18 +248,18 @@ configuration:
259
248
.. code-block :: xml
260
249
261
250
<?xml version =" 1.0" encoding =" UTF-8" ?>
262
- <!-- src/Acme\BasicCmsBundle \Resources\services.xml -->
251
+ <!-- src/AppBundle \Resources\services.xml -->
263
252
<container xmlns =" http://symfony.com/schema/dic/services"
264
253
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
265
- xmlns : acme_demo =" http://www.example.com/symfony/schema/"
254
+ xmlns : app =" http://www.example.com/symfony/schema/"
266
255
xsi : schemaLocation =" http://symfony.com/schema/dic/services
267
256
http://symfony.com/schema/dic/services/services-1.0.xsd" >
268
257
269
258
<!-- ... -->
270
259
<services >
271
260
<!-- ... -->
272
261
273
- <service id =" acme_basiccms.basic_cms .phpcr.initializer"
262
+ <service id =" app .phpcr.initializer"
274
263
class =" Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer" >
275
264
276
265
<argument >My custom initializer</argument >
@@ -288,10 +277,10 @@ configuration:
288
277
289
278
.. code-block :: php
290
279
291
- // src/Acme/BasicCmsBundle /Resources/config/services.php
280
+ // src/AppBundle /Resources/config/services.php
292
281
$container
293
282
->register(
294
- 'acme_basiccms.basic_cms .phpcr.initializer',
283
+ 'app .phpcr.initializer',
295
284
'Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer'
296
285
)
297
286
->addArgument('My custom initializer')
@@ -349,10 +338,10 @@ Ensure that you have the following package installed:
349
338
350
339
Create a page for your CMS::
351
340
352
- // src/Acme/BasicCmsBundle /DataFixtures/PHPCR/LoadPageData.php
353
- namespace Acme\BasicCmsBundle \DataFixtures\PHPCR;
341
+ // src/AppBundle /DataFixtures/PHPCR/LoadPageData.php
342
+ namespace AppBundle \DataFixtures\PHPCR;
354
343
355
- use Acme\BasicCmsBundle \Document\Page;
344
+ use AppBundle \Document\Page;
356
345
use Doctrine\Common\DataFixtures\FixtureInterface;
357
346
use Doctrine\Common\Persistence\ObjectManager;
358
347
use Doctrine\ODM\PHPCR\DocumentManager;
@@ -383,13 +372,13 @@ Create a page for your CMS::
383
372
384
373
and add some posts::
385
374
386
- // src/Acme/BasicCmsBundle /DataFixtures/PHPCR/LoadPostData.php
387
- namespace Acme\BasicCmsBundle \DataFixtures\PHPCR;
375
+ // src/AppBundle /DataFixtures/PHPCR/LoadPostData.php
376
+ namespace AppBundle \DataFixtures\PHPCR;
388
377
389
378
use Doctrine\Common\DataFixtures\FixtureInterface;
390
379
use Doctrine\Common\Persistence\ObjectManager;
391
380
use Doctrine\ODM\PHPCR\DocumentManager;
392
- use Acme\BasicCmsBundle \Document\Post;
381
+ use AppBundle \Document\Post;
393
382
394
383
class LoadPostData implements FixtureInterface
395
384
{
0 commit comments