PHP Scaffold Class
Update: This class has been released and is now available for download.
I've done web development for quite some time now and I hate writing CRUD as much as the next guy. As a developer your goal should be to not ever write the same code twice. But when creating CRUD systems for different projects this is impossible. You always find yourself doing the same thing, over and over again. Most coders have been enticed by Ruby on Rails's "weblog in 15 minutes" screencast. There are also PHP frameworks that boast the same functionality. I've never had the desire to learn any of these systems and, honestly, EzSQL teamed with Smarty gets the job done quite nicely.
A few years ago I ran across this article and ever since I have been building on the ideas presented to create an extremely powerful PHP Scaffold Class that I have used in numerous production sites. In it's simplest implementation, all you do is pass the table name to the class and the scaffolding is created based on the table's structure. Over time I've added functionality for table relationships, image uploading and resizing, and more.
I imagine this class could be very useful to the PHP community. I plan on refining it further and eventually making it available to the public. My purpose in writing this post is to find out if there's any interest in this sort of thing and to see if, and how much, people would be willing to pay for a license to use it. Your feedback is welcome in the comments below.
Features
- Parent/Child relationships
- Image uploading and resizing
- Thumbnail generation
- WYSIWYG text fields
- Disable certain actions (show, add, edit, or delete)
- Handles SET or ENUM fields as select boxes
- Sort by any of the columns
- Pagination
- Hide different columns from the listing table or from all views
- Automatic recognition and handling of created and modified date fields
- Extremely flexible
Demo
I've setup an example of a simple store backend to show its functionality. You can view the code and database structure by clicking the links at the top. Here is an example of a frontend that has been built on top of a backend powered by this class.
June 1st, 2010 - 11:20
It’s been almost two years and this guy is still saying that he’s gonna release it. I don’t believe it anymore.
June 1st, 2010 - 11:22
LOL @Jerry
June 1st, 2010 - 11:29
@jerry, I completely understand your sentiment. This has taken way too long, but that’s how life goes sometimes.
But to give an update, the class itself is completed and all the methods are documented. The only thing I have left to do is create a demo showing how to implement all the various features.
For everyone who’s interested, the license will cost $29 and it will permit usage on an unlimited number of sites.
If anyone is ready to start implementing it, I’ll need a few beta testers in the next few weeks. For helping out with the testing, I can offer a license for $19. Please use the contact form on my site to let me know if you’re interested.
June 2nd, 2010 - 10:39
@eliezer (and whoever else wants!): If I implement automatic table relations on http://github.com/tute/phpscaffold/ , would you be willing to donate?
The license is unlimited, as long as it keeps being Free Software!
June 27th, 2010 - 17:41
I am happy to announce that (after a few years of waiting) the Scaffold class is now available for download/purchase. Find all the details at http://www.aaronharp.com/dev/php-scaffold-class/. Feel free to contact me with any questions you might have!
June 28th, 2010 - 13:10
It’s great… highly recommended, easy to use PHP CRUD implementation.