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

cleanup menu parent documentation #496

Merged
merged 1 commit into from
May 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bundles/menu/menu_documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Menu Documents
In accordance with the
:ref:`CMF bundle standards <contrib_bundles_baseandstandardimplementations>`
you are provided with two menu node implementations, a base document and a
standard document.
standard document. Both exist in the ``Model`` namespace as storage agnostic
classes and in ``Doctrine\Phpcr`` with specific features for PHPCR-ODM.

Base Menu Node
--------------
Expand All @@ -20,11 +21,11 @@ the KnpMenu component documentation for more information.

use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNodeBase;

$parent = ...;
// find the menu tree root
$mainMenu = $dm->find('Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu', '/cms/menu/main');

// ODM specific
$node = new MenuNodeBase();
$node->setParentDocument($parent);
$mainMenu->addChild($node);
$node->setName('home');

// Attributes are the HTML attributes of the DOM element representing the
Expand Down Expand Up @@ -63,6 +64,7 @@ The Standard Menu Node
The standard menu node supports the following CMF specific features
out-of-the-box:

* Methods to set and get parent document;
* Content association;
* Link type specification (URI, route or content);
* Standard :doc:`publish workflow <../core/publish_workflow>` integration;
Expand Down