Skip to main content

Posts

Showing posts from February 13, 2013

Creating simple, extendible CRUD, using Zend Framework

The Form Creating a nice, easy to maintain form, starts with a form class. Creating your forms procedurally in your controller/actions is horrid. please don’t do it. To start with creating your form classes, you need your own namespace in your library. If you don’t have this, register one. This can be done by adding an _initAutoloading method to your Bootstrap. below is a short example. its not comprehensive (you can also do this in your ini i believe, but I use php configuration files similar to DASPRiD ‘s, and i’m not trying to show how to set up autoloading here.) class Bootstrap extends Zend_Application_Bootstrap { //... /** * Initilise autoloader and library namespaces */ public function _initAutoloading ( ) { $loader = Zend_Loader_Autoloader :: getInstance ( ) ; $loader -> registerNamespace ( 'My_' ) ; } //... } Your next task, create a form. This is pretty simple. I will demonstrate us...