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.
August 30th, 2008 - 13:41
Sweet mother. This is hot stuff man.
September 2nd, 2008 - 15:22
Wow great stuff Aaron. Makes me want to learn PHP just to utilize this
September 5th, 2008 - 02:32
Hi Aaron, I would be interested in this Class. It certainly looks like it could save a great deal of time. Let me know what if you ever release it.
September 14th, 2008 - 16:53
Hi man. Great Work.
Im Pablo Impallari, php developer from Argentina.
I will like to use it and improveit.
Are you planning on releasing it?
September 16th, 2008 - 14:52
HURRY…
September 29th, 2008 - 14:20
add me to the list!
October 1st, 2008 - 12:59
How do I get that class?
October 2nd, 2008 - 11:38
Looks excellent! Can we get the preview version at least?
Thanks!
October 2nd, 2008 - 14:14
My question is really whether people would be willing to pay for licenses to use it. Maybe $25 or so. Reason being, I’ve put many hours into this, it will take many more hours to finish it up and document it. On top of that, it will save you countless hours of backend development. I’d say an average CRUD backend takes 4-6 hours to code out. So that’s less work and more money for you. What do you think?
October 3rd, 2008 - 02:26
I would be prepared to pay a one off license (e.g unlimited use – not on a site by site basis) for it… but the sooner the better. I have started working my own version compatible with an open source framework I use… but would rather pay to use yours instead.
October 10th, 2008 - 08:17
Hey Aaron,
interested for sure, CRUD is the major reason why developers get bored of a project. Licensing, sure (one-time, no usage limit).
Have any time table you can share ?
October 11th, 2008 - 18:05
I would give you my bucks too man, please hurry up!
October 17th, 2008 - 08:02
I’d be happy to pay, but need it like, ehm yesterday
October 17th, 2008 - 08:08
still working on this Aaron?
October 17th, 2008 - 08:12
I’m currently pretty occupied with school and work. As soon as I find some time (probably mid-November) I’ll finish this up. Thanks for the interest.
October 17th, 2008 - 08:13
drop out of school buddy
just kiddin…
December 2nd, 2008 - 22:23
Aaron, any update on when you plan on releasing this? Very Cool!
December 8th, 2008 - 00:27
Any updates on a release date? It looks amazing!
February 9th, 2009 - 14:17
Sounds like an amazing library! It exists since last summer, and yet not released? Too bad… if you dont have time to finish this, let someone else do! You said you used this in comercial project. It means you already got paid for writing this, and you are apparently still able to release it to the public? Why are you hesitating, man? Help the comunity like it helped you out before – this is a free bet
Come on we need this. If you do not make this GPL, it is really a waste of time. Cheers
February 9th, 2009 - 16:47
@aurelien: Thanks for your feedback. The reason I’m considering licensing it is that it’s a ways from being ready for release. I need to do lots of code cleanup, testing, and document how everything works, which will take a lot of time (the reason it’s not done yet). My thoughts are that it will save developers many hours of coding so why would someone not pay $25 for an unlimited license to use it? I could ask for donations, but that doesn’t ever work. If I had thousands of dollars sitting around, releasing it GPL wouldn’t be a problem. However, I’m trying to make a living and pay for ridiculous tuition costs. We’ll see what happens though.
February 21st, 2009 - 05:34
This looks like great stuff ! It’s too bad you have not released it yet, give it away, open source it, sell it, but please release !
Don’t worry about the cleaning, if it does the job it will be clean enough for me, and if it doesn’t the code is just PHP after all, it’s not like we can’t fix the bugs (and even send the patches back
…
March 3rd, 2009 - 04:23
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
March 22nd, 2009 - 20:53
hi,
First, I would like to congratulate you for being the first to do this. I have used other scaffoldings and have not come across ones with the parent-child relationship or relationship with foreign keys. However, please release…hehehe
thanks and congrats.
May 10th, 2009 - 19:21
This sounds awesome. I’m sure there are plenty of people ready to pay for this.
May 10th, 2009 - 20:33
The summer is approaching so I will have more time to polish it. I imagine it’ll be released in the next month or two.
I was using it the other day in a project and I came across some major security vulnerabilities. It’s a good thing I didn’t hastily release it =).
June 23rd, 2009 - 15:31
“The summer is approaching so I will have more time to polish it. I imagine it’ll be released in the next month or two.”
Any Update?
June 25th, 2009 - 09:28
Your time is up!
I’m very interested in your library. I will make sure we pay you for it so long as you can release a fairly stable release in the coming weeks. Otherwise, I will have to move on. Keep up the good work!
August 14th, 2009 - 00:05
Here is a free still-green but useful project:
http://github.com/tute/phpscaffold/tree/master
Best regards;
Tute.
August 14th, 2009 - 07:06
Hi Aaron,
I’m disposed to pay. It’s is already stable?
It look great!
Contact me if you can release in one o two weeks.
Regards.
September 30th, 2009 - 15:13
I’ll pay you $50 if it does what you say it does
Although the demo speaks for itself
Very good job mate. PHP Scaffolding was one of the things I’ve always tried to create but quit in the first 30 minutes
October 13th, 2009 - 04:56
Any news on the scaffold class Aaron? I’ve been drooling over your demo for the past 2 months mate!
I got 2 projects to finish soon and I was hoping for some uber scaffolding.
Really… really looking forward for an answer!
October 13th, 2009 - 06:38
Ey, Peter, give also http://github.com/tute/phpscaffold/ a try, it’s worth it. It’s now saving me time on each new project, and it works just fine.
It’s not so complex so you can then customize as needed, and yet it automates the repetitive stuff.
It works, and it’s free!
October 13th, 2009 - 08:32
Peter,
You could also try Crudder on http://crudder.net, Free, AJAX-based and easy to setup. If you want the latest version send me an email.
October 13th, 2009 - 10:55
Tute I tried the phpscaffold and didnt really meet my expectations I suppose.
Trying crudder atm button.
Thanks for your proposals and hard work, guys.
Regards.
October 13th, 2009 - 13:45
I like how this has become a place for everyone to advertise their PHP Scaffolding
The hold up is that I really should rewrite the whole thing (and I’m completely busy). But I’ll have self-control and only fix and tweak it. I’m gonna work on it later this week and some next week and see what I can get done.
Again, sorry for the delay.
November 24th, 2009 - 11:42
Is it better than…
http://www.phpscaffold.com
if it is I’d give you 30 for an unlimited license too.
i’d love one that does comboboxes.. for i.e..
TABLE ‘users’
————-
user_id
user_name
country_relation FK
TABLE ‘countries’
————-
country_id PK
country_name
And then when I’m editing a row of these tables the user table CRUD should show a combobox with COUNTRY NAME as the option name and COUNTRY ID as the option value.
If it does that, I’ll be glad to pay and please notify me.
November 24th, 2009 - 19:36
Short answers: yes, it’s better than (it’s many iterations from) phpscaffold.com. And no, it doesn’t “see” table relations.
If they are simple relations, I like to write them off, and if they start to get more complex, I move forward to a framework (CakePHP for instance).
Best regards,
Tute.
November 25th, 2009 - 10:42
Nice. thanks.
November 28th, 2009 - 18:40
hi Aaron,
the good thing about releasing it early is that, people like us, will give you more feedback on its bugs and flaws which you could improve and fix in time. At least you will get more beta testers than just yourself. Sometimes, it’s really hard to find these bugs when you’re alone doing everything and that you are also busy doing other things as well,
This project has been long overdue, I suppose and soon as all other tools with web 2.0 are all coming up, you might hit the wall of obsolescence.. just a thought…
anyways, kudos to you if this scaffold is really what you claim to be…
December 2nd, 2009 - 08:44
I’m interested
Super cool work dude, think a lot of people would find this interesting, and be willing to spend cash on…
G
January 6th, 2010 - 16:56
Hi Aaron,
Came across this page when I was looking for CRUD frameworks at work. We were also interested in this and very impressed by your demo. A little more appetite-whetting could be had with a demo of how much coding is required by the user of the library. We definitely could be intrigued by it.
–Greg
February 25th, 2010 - 05:15
hello there.
compliments for the great job.
any news on a possible release?
best regards
March 30th, 2010 - 14:00
omg this guy is just trollin. no offence but u havent released it since 2008.
funny how people get excited about this.
March 30th, 2010 - 14:34
Nobody will probably believe me, but I actually have been working on it and it’s pretty much done. I just need to do some final testing and documentation. I’ll keep everyone posted.
April 8th, 2010 - 09:08
Just commenting so I can get an email notification of your release.
April 9th, 2010 - 16:52
me too. thanks
April 12th, 2010 - 08:58
would appreciate an update when its ready?
April 26th, 2010 - 16:38
has this been released? I’d LOVE to take a look.
May 31st, 2010 - 02:40
I’m also interested
June 1st, 2010 - 11:18
Very interested