PHP CRUD in a few lines of code

When building back office and administration systems we often we need to provide end users and administrators with access to database tables and the ability to Create, Read, Update and Delete records. Creating a user interface for this can be time consuming and a nuisance to update if ever end-user requirements or database structures change.

GroceryCRUD runs on the CodeIgniter PHP framework and allows the creation of a user friendly and feature rich CRUD system in only a few lines of code.

GroceryCRUD is installed by copying the necessary files into your working CodeIgniter installation (instructions here). Once you’ve done that, you can literally create a working CRUD system by adding the following code to one of your controllers:

function offices()
    $output = $this->grocery_crud->render();

In this example, assuming you have a table in your database named offices, a full CRUD system would be available in this controller allowing the user full control over the data.

Whilst this example is incredibly simple, GroceryCRUD is in fact highly customisable and allows the developer to decide exactly what data is available, how it is formatted and what can be edited. You can even join and edit multiple tables!

GroceryCRUD combined with A3M authentication and security for CodeIgniter can be used do deliver a complete back office solution for your application in under an hour!

Be the first to comment on "PHP CRUD in a few lines of code"

Leave a comment

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.