Aaron Harp

30Aug/0857

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.

Comments (57) Trackbacks (2)
  1. Sweet mother. This is hot stuff man.

  2. Wow great stuff Aaron. Makes me want to learn PHP just to utilize this :)

  3. 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.

  4. 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?

  5. add me to the list!

  6. How do I get that class?

  7. Looks excellent! Can we get the preview version at least? :) Thanks!

  8. 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?

  9. 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.

  10. 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 ?

  11. I would give you my bucks too man, please hurry up!

  12. I’d be happy to pay, but need it like, ehm yesterday :)

  13. still working on this Aaron?

  14. 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.

  15. drop out of school buddy :-)

    just kiddin…

  16. Aaron, any update on when you plan on releasing this? Very Cool!

  17. Any updates on a release date? It looks amazing!

  18. 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

  19. @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.

  20. 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 :-)

  21. Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  22. 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.

  23. This sounds awesome. I’m sure there are plenty of people ready to pay for this.

  24. 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 =).

  25. “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?

  26. 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!

  27. Here is a free still-green but useful project:

    http://github.com/tute/phpscaffold/tree/master

    Best regards;

    Tute.

  28. 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.

  29. 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 :)

  30. 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!

  31. 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!

  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.

  33. 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.

  34. 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.

  35. 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. :)

  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.

  37. Nice. thanks.

  38. 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…

  39. I’m interested ;-)

    Super cool work dude, think a lot of people would find this interesting, and be willing to spend cash on…

    G

  40. 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

  41. hello there.
    compliments for the great job.

    any news on a possible release?

    best regards

  42. omg this guy is just trollin. no offence but u havent released it since 2008.

    funny how people get excited about this.

  43. 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.

  44. Just commenting so I can get an email notification of your release. :)

  45. would appreciate an update when its ready?

  46. has this been released? I’d LOVE to take a look.

  47. I’m also interested


Leave a comment


WordPress Lightbox 2 by Zeo