Scaffolding with PHP May 20, 2011Posted by Tournas Dimitrios in PHP.
The most basic functionality that a PHP application must support is Database-Backend CRUD operations ( Creating , Reading , Updating and Deleting ) . Creating the code from scratch is of course time-consuming and in some cases error prone . Scaffolding is a meta-programming method for building Database-backend software applications. It is a technique supported by many model-view-controller frameworks . Actually the process is simple we provide the skeleton of our Database Table and it will produce the code files (delete.php , edit.php , list.php ) for us .
The only think we have to change are the credentials for the Database connection . Of course an application targeted for production environments must take some security measures into account , like : escaping and validating input fields , hashing password field … Although the code is not ready for production , the developer has gained a lot of time up to this point and only need to finishing the code with the security measures and probably with some layout .
A nice website to Scaffold your PHP code for Database-Backend functionality is phpscaffold.com . The process is simple :
- Export the skeleton of you Database table in SQL format
- Visit phpscaffold.com
- Paste your SQL code in the form and press ” Make my pages”
- Download the files to your development server
- Make all the necessary changes : Database credentials , add code for validating – escaping the input fields , hash password field ….
- Your are done
Developers that have experience with the Flex 3/4 SDK are familiar with the Scaffolding functionality as the Eclipse IDE has this functionality included . Unfortunately there is no official Zend Framework scaffolding implementation out there , only a few pieces of code here and there , have a look at these links