14.06.2013 Views

The Symfony CMF Book

The Symfony CMF Book

The Symfony CMF Book

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Listing 11-15<br />

<strong>The</strong> above on its own will not be enough however, because there is no parent ($parentPage) to link the<br />

blocks to. <strong>The</strong>re are several possible options that you can use as the parent:<br />

• Link the blocks directly to the root document (not shown)<br />

• Create a document from the PHPCR bundle (shown below using the Generic document type)<br />

• Create a document from the <strong>CMF</strong> ContentBundle (shown below using StaticContent<br />

document type)<br />

Using the PHPCR<br />

To store a <strong>CMF</strong> block directly in the PHPCR, create the following class inside your DataFixtures/PHPCR<br />

directory:<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

17<br />

18<br />

19<br />

20<br />

21<br />

22<br />

23<br />

24<br />

25<br />

26<br />

27<br />

28<br />

29<br />

30<br />

31<br />

32<br />

33<br />

34<br />

35<br />

36<br />

37<br />

38<br />

39<br />

40<br />

41<br />

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

Saved successfully!

Ooh no, something went wrong!