ZF Crud libs

Libraries to scaffold admin area with Zend Framework (v1.8 – v1.11), composed by

  • Abstract Action Controller with all the logic for CRUD actions (Create, Read, Update, Delete). There are protected method to define post/pre actions. Actions can be completely redefined by inheritance. Read Action implements filter to paginate, order, search data (all kept via GET)
  • Abstract Zend Form that reads the table structure and select the forms with automatic selection of the best Element depending on the database field. White/Black list options. Element completely customizable by inheritance. Used in Create/Update actions.
  • Abstract Zend DbTable, that implement a simple interface to communicate with other components
  • Helpers, Interfaces and some Ajax components (not revised for demo application) to make dropdown for 1/N relationships, ajaxN-N relationships, javascript autocomplete for 1-N (to revise) and other common form elements
  • Command line tool to create all the instances
  • SVN branch with all the classes using namespaces (PHP 5.3)

Notes: unit testing and full documentation are not planned yet.  To use these libraries, checkout the  SVN (public readable access) that contains the full working demo application with the Crud libraries (see section below to see it working online). Read comments inside classes.
Last updates are added to the branch (namespace version) and latest changes will not merged in the future.
Support for these libraries is not provided. Use at your own risk. New BSD licence (see below). Contact me if you want to collaborate, or click here to donate and support the development.

REPOSITORY / BROWSE CODE (public readable access)

git clone git://github.com/phpntips/CRUD.git
page on github : https://github.com/phpntips/CRUD
deprecated SVN rep: http://svn.phpntips.com/zf-crud/trunk 

QUICKSTART

[ Under construction. ]

Checkout SVN, Import sql files from /data/db, add ZF libs under /library, customize application.ini, create virtualhost, open it and go to /admin to see the sample application.
Libraries are under /library/Crud. Main classes: abstract CRUD controller, abstract model, abstract form, abstract order form, abstract filter form. Each CRUD action works on ONE data model (Zend Db used, but any other data source supported by implementing interfaces).
Script view index for each controller should be customized, If not found, the actions is rendered inside the controller (same for all actions).

ONLINE SAMPLE APPLICATION

http://crud.phpntips.com/admin/
No password needed.
zend scaffolding crud libraries

LICENCE

Copyright (c) 2011, Elvis Ciotti
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Zend Technologies USA, Inc. nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.