CRUD Class

php Add comments

I have intention to complete my draft of a CRUD PHP-class. Don’t know what is it? Easy!

Imagine you have a site where users point some places at Google Maps framed at your page. As developer of this site you will have to create several admin pages:

  • a page to manage users: e.g. grant permissions to your friend or deactivate a gonzo user
  • another page to tune options of the map points: fix a typo or edit coordinates of points

Just two pages, but I bet you’d need at least 3-5 hours to make a small draft form to manage these entities. To make things worse, let me remind you of paging, client and server sides validation, date-picker dialogs or even data integrity checks.

So, to cut the long story short, CRUD class generates all this for you in a couple of lines of code. So you just define what database table you’d like to manage – drum-roll! – you get a ready-made interface! (I call it a Table Manager Class – it helps you to manage any table in your system)

By the way, CRUD stands for Create, Read, Update and Delete. So CRUD class allows to play with data you have.

As Petrovich said (a laboratory assistant in my university), “first check what others have done”.

So, I found a CRUD class and I remember about Symfony framework admin generator.

CRUD class

While the former is rather crude (it doesn’t work in some conditions, settings are embedded in PHP code), Symfony’s generator is quite nice: settings are separated from logic in a Yaml file and the code is being regenerated for you every time you make a change.The drawback of the latter is that you have to deal with huge Symfony framework to have this feature.

Symfony admin generator

So my idea is to prepare a stand-alone PHP class to make generation of admin inteface easier. I’m going to use an Ext.js JavaScript framework to beautify the interface.

Maybe someone has a better solution?

Andrisi suggests this to be like this:

A draft of CRUD

6 Responses to “CRUD Class”

  1. daniel englert Says:

    Sounds great, we’ve used Symfony before and found while it is an amazing platform the framework is too big for most small projects. Something simpler like you are developing sounds much more appealing.
    Can’t wait to see what you come up with.

  2. Andrisi Says:

    Please contact me if you’d like to work together on this! I’m really interested in your thoughts, ideas… Bye.

  3. Skakunov Alexander Says:

    Yes, sure!

  4. Paul Says:

    Is anything like this available for fusebox, or cold fusion for that matter?

  5. Skakunov Alexander Says:

    It will be implemented in PHP, so that you could plug it in into your PHP Fusebox app.

  6. droope Says:

    Hi. I have, and believe there is, a big need for this. I can’t stand building forms, validating them. Annoying!

    Right now I am @ work, but please, contact me so that we can work together on our efforts.


WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in