Symfony2
Content Management Framework

About David Buchmann
Twitter: @dbu
David is a senior developper at Liip SA, specializing in Symfony2. He happens to also be a certified Scrum Master and sometimes enjoys doing the scrum master or product owner role for a project.
Liip is doing custom web development with PHP in Switzerland.
Drupal is awesome - if you are an end user!
Powerful admin interface
Drupal is awesome - if you are a sales guy!
Well known brand
Drupal sucks if you are a developer!
Drupal is CMS first, dev framework second
This is a legitimate prioritization for their users
Drupal developer nightmares ..
- .. no clean separation of configuration, logic and content
- .. no clean deployment and staging concept
- .. inconsistent cache layers
- .. function callback AOP is not every ones cup of tea
- .. lots of legacy baggage
- .. NIH (not invented here) syndrom (until Drupal 7)
Note the Drupal guys agree and are actually collaborating with Symfony2 to improve
Do we also suffer from NIH?
- Collaboration with Drupal and other frameworks to share basic content management code
- Based ourselves on standard tools and specs
- Leverage existing bundles and technologies of the Symfony and web world
CMF = Content Management Framework
- In other words: a toolbox to create your own custom CMS
- Not a one size fits all, but increase code sharing
- Imagine Drupal, ezPublish, Diem, Sympal all build on the same content foundation
The Symfony CMF project makes it easier for developers to add CMS functionality to
applications built with the Symfony2 PHP framework. Key development principles for the provided
set of bundles are scalability, usability,
documentation and testing
Welcome to the real world
At Quiet Storm Solutions, a UK based B2B marketing specialists, we are successfully utilizing the CMF and Jackalope Doctrine-Dbal to drive our newly launched Saas CRM service.
Pete Sisson
- ServerGrove is using the PHP content repository in their KnowledgeBase tool.
- Liip integrated the CMF as a simple editing solution into Symfony web applications like www.barometredesprix.ch.
- Eat your own dog food: The Liip website is built on top of the CMF
Interest is huge!
- Over 300 people on the mailinglist
- About 5-10 more per month
- All key decisions have been made in public forums
- Multiple people are working and committing to all parts of the code
Symfony2 CMF Project
Overview of the components
An overview with lots of pictures.
Content management framework,
not content management system
- Use what you can
- Replace what you need
- Ignore what you do not need
- Collection of modular tools to do content management
- Not a ready-to-use application for end users
Content Management means user controlled:
- Content: Createjs frontend editing, Sonata admin
- Menu structure: Provider for KnpMenuBundle
- Routes (URLs): RoutingExtraBundle together with Drupal
- Page structure (to some extent): Block bundle based on Sonata BlockBundle
Symfony2 Control Flow
Â

Symfony2 Control Flow
CMF additions

At a glance

Routing
- ChainRouter allows to have several routers in action
- DynamicRouter for user-defined routes from a data store
- Specifies controller and page content to use
- Or just the template instead of controller (with the ContentBundle)
Content Bundle
- Provides generic controller so you need only a custom template
- Simple StaticContent model and template
Menu Bundle
- Integrate KnpMenuBundle with Doctrine
- Menu documents reference content documents
- Generates URL for content

Block: Sonata PHPCR ODM BlockBundle
- Based on the SonataBlockBundle
- Multiple blocks per page
- Blocks can be reused on different page

Frontend Editing: Create.js
- backbone.js based editing framework
- Uses RDF annotations to detect editable data
- Comes with hallo.js for contentEditable
- Symfony2 integration for saving data via REST

Backend: Sonata PHPCR ODM AdminBundle
- Based on the SonataAdminBundle
- Supports tree oriented data

PHPCR and the ODM

- PHP Content Repositories API specification
- Graph-based, schema-less, versioning document database
- Doctrine PHPCR ODM: map nodes to your objects
- Add features like multilanguage
Other related Bundles
- SymfonyCmfSearchBundle (content search, extends LiipSearchBundle)
- SymfonyCmfSimpleCmsBundle (a simple CMS incl. content authoring)
- LuneticsLocaleBundle (automatic locale detection)
- Planning integration with several more Sonata Bundles
Some words on storage
Doctrine PHPCR ODM
PHP Content Repository + Doctrine ODM
PHPCR (aka PHP-ified JCR specification)
Like MongoDB or CouchDB ODM but different
- Includes tree/graph structure
- Translated documents
- Versioning
- Access control
- Node and subtree locking
- and more
PHPCR provides a standardized API that can be used by any PHP content management system to interface with any content repository.
PHPCR has been submitted to the JCR spec at the request of David Nüschler, JCR spec lead
Not all data fits well in PHPCR/JCR
- For example aggregation is better done in an RDBMS
- Store web store product description in PHPCR/JCR
- Store web store inventory and orders in RDBMS
Next steps as of november 2012
- Improve the CMF documentation
- Frontend editing: Enable collection support of create.js to add new items
- Clean Jackalope import and export commands to have reliable backups
- We hope to tag stable releases around the time Symfony 2.2 is released
Constantly moving... The best entry point to see what is going on right now is the CMF Roadmap