简体   繁体   中英

Simple CRUD Generation

This is what I have:

  • An entity-relational schema, modelled for Doctrine 2.0 (in PHP);
  • The generated database, on a MySQL server.

This is what I want:

A very basic CRUD web-interface to the database, that allows me to (you guessed it!) create, read, update and delete records, with extra credit for implementing CRUD operations on entities and relations instead of records.

Now, I'm terrible at writing web applications myself (read: I'm lazy). Are there any options to generate a CRUD web application from a MySQL database, or from a set of Doctrine entities?


  1. I'd be willing to stop using PHP (and thus rewrite the entities for JPA, Ruby ActiveRecord, etc...) but not MySQL.
  2. I see a lot of similar questions: however, most of these questions have answers that give CRUD operations for in PHP code, or recommend using Doctrine.
  3. An answer such as "There is no such tool, stop being lazy" would also be appreciated.

You should have a look at Grocery CRUD.

Really simple, easy to use /deploy and neat UI.

http://www.web-and-development.com/grocery_crud/

I did a complete web CRUD of my DB in a couple of hours (including additional PHP webservices) Amazing :-)

Symfony does this (at least the 1.x series I am used to). I should think version 2.0 also does, under either Doctrine or Propel (and both of those will work with MySQL).

CakePHP ( user guide ) takes a database model and generates controllers that do basic CRUD operations for all of your tables. It also includes views and a basic stylesheet.

If your hosting setup can handle Python, the web2py framework offers instant CRUD for a database and a very user friendly (and laziness-friendly) online dev environment. I don't think it's designed to be laid overtop of an existing database, but you can import a CSV file with your database contents. http://www.web2py.com

One of the great things about web2py is that creating custom (public) CRUD pages is also dead easy. In a controller file it's as easy as

form = CRUD.create(db.myTable)
return dict(form = form)

Then in a view file you just add

{{=form}}

And that's it! All of the form creation, input validation, etc., is handled for you. I should also add that the data abstraction layer in web2py is very easy to learn and meshes with mySQL easily. One great thing about it is that web2py performs on-the-fly changes to your datastructure or even migrations from one DB back-end to another.

Not every hosting company knows how to support web2py, but it's easy to deploy on the Google App Engine or with a company like Fluxflex.com

I've been looking for a drop-in admin panel like this too, so far I've 3:

AjaxCrud - http://ajaxcrud.com/ Peek from Code Canyon - http://bit.ly/toKKrB SQLBuddy - http://www.sqlbuddy.com/

Love to hear any other suggestions!

Ruby on Rails的“脚手架”应该是你正在寻找的......

As according to this answer , I've tried Xataface , which gave me as decent a result as CakePHP or Web2Py would have given me. Am now trying Symfony 2.0 (which is a lot harder then I'd have expected) for the extra credit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM