Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 3f8dd20

Browse files
committed
Merge branch '1.2'
Conflicts: book/installation.rst bundles/menu/sonata_admin.rst
2 parents b92606a + e9e27f5 commit 3f8dd20

File tree

9 files changed

+41
-23
lines changed

9 files changed

+41
-23
lines changed

_images/cookbook/basic-cms-intro-sketch.ep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
<foreignObject x="0" y="0" width="77" height="15" p:name="htmlObject" id="3f77b24bb67c43c58a9d3fe2eca38a28" style="color: rgb(0, 0, 255); opacity: 1; font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;">
6262
<div xmlns="http://www.w3.org/1999/xhtml" p:name="textDiv" id="0931c1825f594a5f8b263000eece8116" style="white-space: nowrap; text-decoration: underline; display: inline-block !important; "><div xmlns="http://www.w3.org/1999/xhtml">MyThird Post</div></div>
6363
</foreignObject>
64-
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.BasicWebElements:htmlLink" id="564d0297914e4492b35d7617f38d737e" transform="matrix(1,0,0,1,27.600006103515625,285.8999938964844)" p:sizing-ox="27.600006103515625" p:sizing-oy="285.8999938964844" p:sizing-ow="79" p:sizing-oh="15"><p:metadata><p:property name="textContent"><![CDATA[MyForth Post]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#0000FFFF]]></p:property><p:property name="customStyle"><![CDATA[]]></p:property></p:metadata>
64+
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.BasicWebElements:htmlLink" id="564d0297914e4492b35d7617f38d737e" transform="matrix(1,0,0,1,27.600006103515625,285.8999938964844)" p:sizing-ox="27.600006103515625" p:sizing-oy="285.8999938964844" p:sizing-ow="79" p:sizing-oh="15"><p:metadata><p:property name="textContent"><![CDATA[MyFourth Post]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#0000FFFF]]></p:property><p:property name="customStyle"><![CDATA[]]></p:property></p:metadata>
6565

6666
<foreignObject x="0" y="0" width="79" height="15" p:name="htmlObject" id="75996185a54f41879de44be59b7fa575" style="color: rgb(0, 0, 255); opacity: 1; font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;">
67-
<div xmlns="http://www.w3.org/1999/xhtml" p:name="textDiv" id="23ebaafa874e4e1aa1150e06c0a156d5" style="white-space: nowrap; text-decoration: underline; display: inline-block !important; "><div xmlns="http://www.w3.org/1999/xhtml">MyForth Post</div></div>
67+
<div xmlns="http://www.w3.org/1999/xhtml" p:name="textDiv" id="23ebaafa874e4e1aa1150e06c0a156d5" style="white-space: nowrap; text-decoration: underline; display: inline-block !important; "><div xmlns="http://www.w3.org/1999/xhtml">MyFourth Post</div></div>
6868
</foreignObject>
6969
</g></g></g></Content></Page></Pages></Document>

_images/cookbook/basic-cms-objects.svg

Lines changed: 4 additions & 4 deletions
Loading

book/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ and then get the Symfony CMF code with it (this may take a while):
6060

6161
.. code-block:: bash
6262
63-
$ composer create-project symfony-cmf/standard-edition <path-to-install> '~1.2'
63+
$ composer create-project symfony-cmf/standard-edition <path-to-install> "~1.2"
6464
$ cd <path-to-install>
6565
6666
.. note::

bundles/map.rst.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ library or they introduce a complete new concept.
4444
* :doc:`menu/menu_factory`
4545
* :doc:`menu/menu_provider`
4646
* :doc:`menu/voters`
47+
* :doc:`menu/sonata_admin`
4748
* :doc:`menu/configuration`
4849

4950
* :doc:`routing/index`

bundles/menu/sonata_admin.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,23 @@ These are the list of available options:
185185
See the `KnpMenuBundle documentation`_ for more information about these
186186
attributes.
187187

188+
Advanced Menu Options
189+
~~~~~~~~~~~~~~~~~~~~~
190+
188191
By default the only available options are **Display** and **Display Children**.
189-
To enable the advanced options you need to add ``burgov/key-value-form-bundle``
190-
requirement in your ``composer.json`` and enable the advanced options in
191-
your config file:
192+
You can enable advanced options, but need to add the BurgovKeyValueFormBundle_
193+
to your project. Run ``composer require burgov/key-value-form-bundle``,
194+
instantiate the bundle in the kernel and extend the template
195+
``SonataAdminBundle:Form:form_admin_fields.html.twig`` to add:
196+
197+
.. code-block:: jinja
198+
199+
{% block burgov_key_value_widget %}
200+
{{- block('sonata_type_native_collection_widget') -}}
201+
{% endblock %}
202+
203+
Once you enabled the bundle, you can enable the advanced menu options in your
204+
configuration:
192205

193206
.. configuration-block::
194207

@@ -232,3 +245,4 @@ your config file:
232245
.. _SonataDoctrinePHPCRAdminBundle: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html
233246
.. _`configuring sonata admin`: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/reference/configuration.html
234247
.. _`KnpMenuBundle documentation`: http://github.com/KnpLabs/KnpMenu/blob/master/doc/01-Basic-Menus.markdown#menu-attributes
248+
.. _BurgovKeyValueFormBundle: https://github.com/Burgov/KeyValueFormBundle

quick_tour/the_router.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Now you can add a new ``Route`` to the tree using Doctrine::
151151

152152
use Doctrine\Common\Persistence\ObjectManager;
153153
use Doctrine\Common\DataFixtures\FixtureInterface;
154+
155+
use PHPCR\Util\NodeHelper;
154156

155157
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
156158

@@ -162,6 +164,9 @@ Now you can add a new ``Route`` to the tree using Doctrine::
162164
$class = get_class($documentManager);
163165
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
164166
}
167+
168+
$session = $documentManager->getPhpcrSession();
169+
NodeHelper::createPath($session, '/cms/routes');
165170

166171
$routesRoot = $documentManager->find(null, '/cms/routes');
167172

tutorial/auto-routing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Enable the routing bundles to your kernel::
4545
}
4646
}
4747

48-
.. note::
48+
.. note::
4949

5050
The `symfony-cmf/routing-bundle` package is installed automatically as
5151
`symfony-cmf/routing-auto-bundle` depends on it.
@@ -206,15 +206,15 @@ You can now proceed to mapping your documents, create the following in your
206206
see the :doc:`../bundles/routing_auto/introduction` documentation for more information.
207207

208208
This will configure the routing auto system to automatically create and update
209-
route documents for both the ``Page`` and ``Post`` documents.
209+
route documents for both the ``Page`` and ``Post`` documents.
210210

211211
In summary, for each class:
212212

213213
* We defined a ``uri_schema`` which defines the form of the URI which will be
214214
generated.
215215
* Within the schema you place ``{tokens}`` - placeholders for values provided by...
216216
* Token providers provide values which will be substituted into the URI. Here
217-
you use two different providers - ``content_date`` and ``content_method``.
217+
you use two different providers - ``content_datetime`` and ``content_method``.
218218
Both will return dynamic values from the subject object itself.
219219

220220
Now reload the fixtures:
@@ -242,12 +242,12 @@ Have a look at what you have:
242242
my-first-post:
243243
my-second-post:
244244
my-third-post:
245-
my-forth-post:
245+
my-fourth-post:
246246
posts:
247247
My First Post:
248248
My Second Post:
249249
My Third Post:
250-
My Forth Post:
250+
My Fourth Post:
251251
252252
The routes have been automatically created!
253253

tutorial/getting-started.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ other documents to hold a reference to the page. The ``Post`` class will also
197197
be referenceable and in addition will automatically set the date using the
198198
`pre persist lifecycle event`_ if it has not been explicitly set previously::
199199

200-
// src/Acme/BasicCms/Document/Post.php
200+
// src/Acme/BasicCmsBundle/Document/Post.php
201201
namespace Acme\BasicCmsBundle\Document;
202202

203203
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
@@ -411,7 +411,7 @@ and add some posts::
411411

412412
$parent = $dm->find(null, '/cms/posts');
413413

414-
foreach (array('First', 'Second', 'Third', 'Forth') as $title) {
414+
foreach (array('First', 'Second', 'Third', 'Fourth') as $title) {
415415
$post = new Post();
416416
$post->setTitle(sprintf('My %s Post', $title));
417417
$post->setParentDocument($parent);
@@ -427,9 +427,7 @@ and add some posts::
427427
}
428428
}
429429

430-
The
431-
432-
and load the fixtures:
430+
Then load the fixtures:
433431

434432
.. code-block:: bash
435433

tutorial/the-frontend.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ The menu system expects to be able to find a root item which contains the
121121
first level of child items. Modify your fixtures to declare a root element
122122
to which you will add the existing ``Home`` page and an additional ``About`` page::
123123

124-
// src/Acme/BasicCmsBundle/DataFixtures/Phpcr/LoadPageData.php
125-
namespace Acme\DemoBundle\DataFixtures\PHPCR;
124+
// src/Acme/BasicCmsBundle/DataFixtures/PHPCR/LoadPageData.php
125+
namespace Acme\BasicCmsBundle\DataFixtures\PHPCR;
126126

127127
use Doctrine\Common\DataFixtures\FixtureInterface;
128128
use Doctrine\Common\Persistence\ObjectManager;
129129
use Doctrine\ODM\PHPCR\DocumentManager;
130-
use Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page;
130+
use Acme\BasicCmsBundle\Document\Page;
131131

132132
class LoadPageData implements FixtureInterface
133133
{

0 commit comments

Comments
 (0)