Developing software in the Real World

Getting started with Zend Framework 2 (beta)

Screen short of Zend Framework 2 tutorial

This tutorial is intended to give an introduction to using Zend Framework 2 to write a simple database driven application.

This tutorial works on RC1 for Zend Framework 2. It should work on later versions, but it will not work on earlier versions.

Tutorial note: If you are getting 404 errors when going to any page other than the home page, please make sure that you have set AllowOverride to All in your Apache configuration and have enabled the mod_rewrite extension.

English version: Download the PDF (v0.6.0).


The associated code is available from github.

Further reading

The Quick Start is worth reading, as is the manual.


0.6.0 (25/July/2012)
Updated for RC1.
0.5.5 (13/July/2012)
Update AlbumForm constructor. Patch by Kat Reeve.
0.5.4 (11/July/2012)
Use ZendDbAdapterAdapterServiceFactory and also rename the album-table service to AlbumModelAlbumTable. Also fixed a minor typo reported by Christoffer Holmstedt.
0.5.3 (10/July/2012)
escape is now escapeHtml(). Reported by Zsolt Kunsagi & Adrien Moiaurd.
0.5.2 (9/July/2012)
Fix configuration of controller as reported by Abdul Ikhsan.
0.5.1 (9/July/2012)
Use the params controller plugin as noted by Michael Gallego.
0.5.0 (9/July/2012)
Updated for Beta 5
0.4.3 (9/June/2012)
Fixed setting of text on the submit button. Reported by Francis Drouillard, Zoltan Nagy & others
0.4.2 (30/May/2012)
Typo fixes! Found by Francis Drouillard & Martin Meredith
0.4.1 (30/May/2012)
Typo fixes! Found by Francis Drouillard & Chris O’Connell
0.4.0 (25/May/2012)
Significantly updated to match Beta 4. Expect typos!
0.3.6 (03/Apr/2012)
Fixes to issues found found by Zachary Burnham.
0.3.5 (30/Mar/2012)
Add class to table as reported by many people.
0.3.4 (20/Mar/2012)
Typo fixes reported by Rob Keplin
0.3.3 (11/Mar/2012)
Typo fixes reported by Dorthe Luebbert
0.3.2 (5/Mar/2012)
Added missing namespace as reported by many people!
0.3.1 (3/Mar/2012)
Bug fix.
0.3.0 (3/Mar/2012)
Update for ZF2 beta 3
0.2.7 (19/Feb/2012)
Fix raising of exception as found by Bart McLeod
0.2.6 (18/Feb/2012)
Another typo fix found by Solow from #zftalk.2.
0.2.5 (4/Feb/2012)
Another typo fix found by Petro Boychuk.
0.2.4 (7/Jan/2012)
Another typo fix found by RWOverdijk from #zftalk.2.
0.2.3 (23/Dec/2011)
Yet more typo fixes found by RWOverdijk and MikeA from #zftalk.2.
0.2.2 (22/Dec/2011)
Even more typo fixes found by Evil_Otto from #zftalk.2.
0.2.1 (21/Dec/2011)
Typo fixes found by Evil_Otto from #zftalk.2.
0.2.0 (20/Dec/2011)
Update to support ZF2 beta 2.
0.1.5 (30/Nov/2011)
Update to support the new parameter order in the url() view helper.
0.1.4 (20/Nov/2011)
Update to support latest changes to ZF2’s ModuleManager.
0.1.3 (6/Nov/2011)
Typos fixed as reported by mtvic and Christoffer Holmstedt.
0.1.2 (23/Oct/2011)
Typos fixed as reported by sandersjj.
0.1.1 (20/Oct/2011)
Typos fixed as reported by Richard Kellner.
0.1 (18/Oct/2011)
Initial release. Only works with ZF2 beta 1.