@@ -23,27 +23,16 @@ Each part of the tutorial will detail the packages that it requires (if any) in
2323section titled "installation".
2424
2525If 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:
2727
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
4429
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
4736
4837 Initialize the Database
4938~~~~~~~~~~~~~~~~~~~~~~~
@@ -80,7 +69,7 @@ Now you can generate the bundle in which you will write most of your code:
8069
8170.. code-block :: bash
8271
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
8473
8574 The Documents
8675.............
@@ -89,8 +78,8 @@ You will create two document classes, one for the pages and one for the posts.
8978These two documents share much of the same logic, so you create a ``trait ``
9079to reduce code duplication::
9180
92- // src/Acme/BasicCmsBundle /Document/ContentTrait.php
93- namespace Acme\BasicCmsBundle \Document;
81+ // src/AppBundle /Document/ContentTrait.php
82+ namespace AppBundle \Document;
9483
9584 use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
9685
@@ -168,8 +157,8 @@ to reduce code duplication::
168157
169158The ``Page `` class is therefore nice and simple::
170159
171- // src/Acme/BasicCmsBundle /Document/Page.php
172- namespace Acme\BasicCmsBundle \Document;
160+ // src/AppBundle /Document/Page.php
161+ namespace AppBundle \Document;
173162
174163 use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
175164
@@ -188,8 +177,8 @@ other documents to hold a reference to the page. The ``Post`` class will also
188177be referenceable and in addition will automatically set the date using the
189178`pre persist lifecycle event `_ if it has not been explicitly set previously::
190179
191- // src/Acme/BasicCmsBundle /Document/Post.php
192- namespace Acme\BasicCmsBundle \Document;
180+ // src/AppBundle /Document/Post.php
181+ namespace AppBundle \Document;
193182
194183 use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
195184 use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
@@ -246,9 +235,9 @@ configuration:
246235
247236 .. code-block :: yaml
248237
249- # src/Acme/BasicCmsBundle /Resources/config/services.yml
238+ # src/AppBundle /Resources/config/services.yml
250239 services :
251- acme_basiccms.basic_cms .phpcr.initializer :
240+ app .phpcr.initializer :
252241 class : Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer
253242 arguments :
254243 - My custom initializer
@@ -259,18 +248,18 @@ configuration:
259248 .. code-block :: xml
260249
261250 <?xml version =" 1.0" encoding =" UTF-8" ?>
262- <!-- src/Acme\BasicCmsBundle \Resources\services.xml -->
251+ <!-- src/AppBundle \Resources\services.xml -->
263252 <container xmlns =" http://symfony.com/schema/dic/services"
264253 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/"
266255 xsi : schemaLocation =" http://symfony.com/schema/dic/services
267256 http://symfony.com/schema/dic/services/services-1.0.xsd" >
268257
269258 <!-- ... -->
270259 <services >
271260 <!-- ... -->
272261
273- <service id =" acme_basiccms.basic_cms .phpcr.initializer"
262+ <service id =" app .phpcr.initializer"
274263 class =" Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer" >
275264
276265 <argument >My custom initializer</argument >
@@ -288,10 +277,10 @@ configuration:
288277
289278 .. code-block :: php
290279
291- // src/Acme/BasicCmsBundle /Resources/config/services.php
280+ // src/AppBundle /Resources/config/services.php
292281 $container
293282 ->register(
294- 'acme_basiccms.basic_cms .phpcr.initializer',
283+ 'app .phpcr.initializer',
295284 'Doctrine\Bundle\PHPCRBundle\Initializer\GenericInitializer'
296285 )
297286 ->addArgument('My custom initializer')
@@ -349,10 +338,10 @@ Ensure that you have the following package installed:
349338
350339 Create a page for your CMS::
351340
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;
354343
355- use Acme\BasicCmsBundle \Document\Page;
344+ use AppBundle \Document\Page;
356345 use Doctrine\Common\DataFixtures\FixtureInterface;
357346 use Doctrine\Common\Persistence\ObjectManager;
358347 use Doctrine\ODM\PHPCR\DocumentManager;
@@ -383,13 +372,13 @@ Create a page for your CMS::
383372
384373and add some posts::
385374
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;
388377
389378 use Doctrine\Common\DataFixtures\FixtureInterface;
390379 use Doctrine\Common\Persistence\ObjectManager;
391380 use Doctrine\ODM\PHPCR\DocumentManager;
392- use Acme\BasicCmsBundle \Document\Post;
381+ use AppBundle \Document\Post;
393382
394383 class LoadPostData implements FixtureInterface
395384 {
0 commit comments