The Symfony CMF Book
The Symfony CMF Book
The Symfony CMF Book
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 11<br />
Using the BlockBundle and ContentBundle<br />
with PHPCR<br />
<strong>The</strong> goal of this tutorial is to demonstrate how the <strong>CMF</strong> BlockBundle and ContentBundle can be used as<br />
stand-alone components, and to show how they fit into the PHPCR.<br />
This tutorial demonstrates the simplest possible usage, to get you up and running quickly. Once you are<br />
familiar with basic usage, the in-depth documentation of both bundles will help you to adapt these basic<br />
examples to serve more advanced use cases.<br />
We will begin with using only BlockBundle, with content blocks linked directly into the PHPCR. Next,<br />
we will introduce the ContentBundle to show how it can represent content pages containing blocks.<br />
Preconditions<br />
Although not a requirement for using BlockBundle or ContentBundle, this tutorial will also make<br />
use of DoctrineFixturesBundle 1 . This is because it provides an easy way to load in some test<br />
content.<br />
• Installation of <strong>Symfony</strong>2 2 (2.1.x)<br />
• Installing and Configuring Doctrine PHPCR-ODM<br />
This tutorial is based on using PHPCR-ODM set up with Jackalope, Doctrine DBAL and a MySQL<br />
database. It should be easy to adapt this to work with one of the other PHPCR options documented<br />
in Installing and Configuring Doctrine PHPCR-ODM.<br />
1. http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html<br />
2. http://symfony.com/doc/2.1/book/installation.html<br />
PDF brought to you by<br />
generated on June 13, 2013<br />
Chapter 11: Using the BlockBundle and ContentBundle with PHPCR | 44