Website License


  • Perpetual license (does not expire)
  • Unlimited sites, servers
  • No distribution (hosted use only)
  • Commercial use allowed
$29.99 Read License

Developer License


  • Perpetual license (does not expire)
  • Unlimited projects
  • Can distribute code and binary products
  • Commercial use allowed
$99.99 Read License

14 Day money-back guarantee

Full refund within 14 days of purchase date.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Feb 4, 2011
    Last Update: Feb 4, 2011
  • Language: PHP
  • Category: Database
(2 ratings)

PHP Scaffold Class

PHP Scaffold Class
Developed by Aaron Harp, Released Feb 4, 2011

Scaffold is a powerful standalone PHP class that dynamically creates CRUD functionality for a database table. It is designed to dramatically decrease the time it takes to get your database-driven application up and running.

PHP

Tags: aaron harp , admin , class , cms

Overview

Scaffold is a powerful standalone PHP class that dynamically creates CRUD functionality for a database table.  It is designed to dramatically decrease the time it takes to get your database-driven application up and running.

When I first saw the Ruby on Rails "weblog in 15 minutes" screencast, I wished that there was an easy way to accomplish the same thing in PHP.  While there are plenty of PHP frameworks with this functionality, I wanted something standalone that I could easily integrate into my projects.  This class is what I came up with.

The class has many features out of the box, but it has been built in such a way that it can be customized to suit your needs.  Additionally, it outputs standard HTML tables which can be easily styled with CSS to fit into your website or application.

Features

  • Support for one-to-many relationships (many-to-many are on the todo list)
  • Image uploading and resizing
  • Thumbnail generation
  • Supports file uploads with extension validation
  • 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
  • Easy to extend and style to fit into various projects  

Demo

I've setup an example of a simple store backend to show its functionality.  Here are two examples of sites that have been built on top of a backend powered by this class.

Back to top

Documentation

Basic Usage

The following code shows the most basic implementation of the class.

mysql_connect('localhost', 'username', 'password');
mysql_select_db('database');
require_once 'Scaffold.php';
$scaffold = new Scaffold('my_table');
$scaffold->build();
$scaffold->output();

Documentation

To view all of the available class methods take a look at the API reference.

Demo

I've setup an example of a simple store backend to show its functionality.  Here are two examples of sites that have been built on top of a backend powered by this class.

Back to top

Change Log

2010.06.26 - v1.0

  • First release

2010.09.02 - v1.1

  • Added support for file upload fields.

2011.01.27 - v1.2

  • Bug and security fixes
View all 2 reviews »

User Reviews

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.