Zend Framework: Zend_Controller_Scaffolding Component Proposal
| Proposed Component Name | Zend_Controller_Scaffolding |
|---|---|
| Developer Notes | http://framework.zend.com/wiki/display/ZFDEV/Zend_Controller_Scaffolding |
| Proposers | Alex Oroshchuk |
| Zend Liaison | TBD |
| Revision | 1.0 - Aug 2010: Initial Draft. (wiki revision: 19) |
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 (https://github.com/lex0r/zendscaffolding) and is used in several projects.
2. References
Guthub Project: https://github.com/lex0r/zendscaffolding
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
Component has a stable release on Github.
7. Class Index
- Zend_Controller_Scaffolding
8. Use Cases
9. Class Skeletons
| View scripts View scripts for corresponding actions will be available. User will have to place them under /views/scripts/scaffolding. |
9 Comments
comments.show.hideAug 21, 2010
Georgy Turevich
Do you have open repository (Google code, Github ...) with work prototype?
Aug 27, 2010
Alex
edited
Yes (see the references)
Sep 04, 2010
porter
Fix UC-4 "// Controller setup" section: what to do with array $fields?
Sep 08, 2010
Alex
just skipped details already described in UC-1. anyway updated the doc to make it more clear
Sep 07, 2010
porter
Request for 2 things:
1. Add second submit button in update view which will save data and not change view. For example, it is useful when editor edit big article.
2. Add opportunity for some optional including of partial view. For example, for adding javascript check to specified fields. It can be done with optional options in the last parameter of initScaffolding.
Sep 08, 2010
Alex
1. Yes, that's a good idea. We can even have three buttons there:
2. If you want a Javascript to be included why not include it with
by placing it in the desired action and calling the default scaffolding action:
Do not forget we extend the scaffolding class, and many things become possible.
Sep 08, 2010
Alex
New buttons added
Jun 22, 2011
Kuba
Small fix:
Should be
If you want to disable actions.
Feb 02, 2012
Andreu Vallbona
Hi Alex,
first of all, congratulations for such a great work.
I would like to know if the scaffolding component you developed has image/file support in the forms update/create ?
Thanks !!