Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Controller_Scaffolding Component Proposal

Proposed Component Name Zend_Controller_Scaffolding
Developer Notes
Proposers Alex Oroshchuk
Zend Liaison TBD
Revision 1.0 - Aug 2010: Initial Draft. (wiki revision: 11)

Table of Contents

1. Overview

Zend_Controller_Scaffolding will provide quick scaffolding features (that every mature framework has) by extending Zend_Controller_Action class. The component has a real code base ( and is used in several projects.

2. References

Google Code Project:

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component provides typical scaffolding actions like CReate, Update and Delete, as well as data lists.
  • This component allows to easily mix scaffolding and custom actions.
  • This component allows to use custom views for scaffolding actions by setting a view path.
  • This component supports sorting of data lists.
  • This component supports partially (and will provide a larger support) data list filtering by one or more data fields.
  • This component supports pagination of data lists.
  • This component supports custom select statements (Zend_Db_Select or Zend_Db_Table_Select) for specific data lists.
  • This component provides several callbacks (through overriding of protected methods) to customize edit and search forms and enhance user experience.
  • This component supports data relationships (and will provide a larger support) when editing related entities (like one-to-many and many-to-many).
  • This component allows to restrict certain scaffolding actions and/or provide data listing only.
  • This component will support scaffolding configuration through Zend_Config.

4. Dependencies on Other Framework Components

  • Zend_Controller
  • Zend_Db
  • Zend_View
  • Zend_Form
  • Zend_Pagination
  • Zend_Validate
  • Zend_Filter

5. Theory of Operation

There are several steps:

  • Decide on data fields available for edition/listing/sorting/search and prepare two configuration structures: list of data (or synthetic) fields and general scaffolding options (like custom view folder, pagination etc.)
  • Initialize scaffolding by passing 3 parameters: data providing class instance and the two configuration structures.

6. Milestones / Tasks

  • Milestone 1: Discussions on design and functionalities.
  • Milestone 2: Working prototype checked into the incubator supporting all use cases.
  • Milestone 3: Unit tests exist, work, and are checked into SVN.
  • Milestone 4: Initial documentation exists.

7. Class Index

  • Zend_Controller_Scaffolding

8. Use Cases


Using scaffolding in a typical situation - back-end user management interface.
Suppose we have a (MySQL) table users with the following structure:

Also we created a model class Application_Model_Users that extends Zend_Db_Table. So, very basic scaffolding initialization will look like this:


Advanced usage with sorting, search, presentation tweaks, pagination.


List filtering (using Zend_Db_Table_Select). Useful for simple reporting.


Handling table relations.
Suppose we have two tables: Readers and Books. Each reader can read one or more books, and each book can be read by many readers.
Also, we want to handle this many-to-many relationship in this way: when registering a new reader we want to assign him immediately
one or more books. We need to do the following:

9. Class Skeletons

View scripts
View scripts for corresponding actions will be available. User will have to place them under /views/scripts/scaffolding.


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.