14.06.2013 Views

The Symfony CMF Book

The Symfony CMF Book

The Symfony CMF Book

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Listing 4-1<br />

Concept<br />

Chapter 4<br />

Menu<br />

No CMS system is complete without a menu system that allows users to navigate between content pages<br />

and perform certain actions. While it usually maps the actual content tree structure, menus often have<br />

a logic of their own, include options not mapped by content or exist in multiple contexts with multiple<br />

options, thus making them a complex problem themselves.<br />

<strong>Symfony</strong> <strong>CMF</strong> Menu System<br />

<strong>Symfony</strong> <strong>CMF</strong> SE includes the MenuBundle, a tool that allow you to dynamically define your menus. It<br />

extends the KnpMenuBundle 1 , with a set of hierarchical, multi language menu elements, along with the<br />

tools to persist them in the chosen content store. It also includes the administration panel definitions and<br />

related services needed for integration with the SonataDoctrinePhpcrAdminBundle 2 .<br />

Usage<br />

<strong>The</strong> MenuBundle extends and greatly relies on the KnpMenuBundle 3 , so you should carefully read<br />

KnpMenuBundle's documentation 4 . For the rest of this page we assume you have done so and are<br />

familiar with concepts like Menu Providers and Menu Factories.<br />

<strong>The</strong> MenuBundle uses KnpMenuBundle's default renderers and helpers to print out menus. You can refer<br />

to the respective documentation page 5 for more information on the subject, but a basic call would be:<br />

1. https://github.com/knplabs/KnpMenuBundle<br />

2. https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle<br />

3. https://github.com/knplabs/KnpMenuBundle<br />

4. https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md<br />

5. https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md#rendering-menus<br />

PDF brought to you by<br />

generated on June 13, 2013<br />

Chapter 4: Menu | 16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!