Of the features in Ruby on Rails, scaffolding is one of the more popular. PHP doesn't have this natively, but with the help of this new article from The Shadow Fox Network, you can create a scaffold-like class for your database table.
If you've ever seen the Creating a Weblog In 15 Minutes movie, you were undoubtedly startled at how useful and quick the scaffold command could be. But if you're still using PHP, and you love that command, then you could have a problem. Luckily, through the use of Object Oriented Programming, an equivalent solution is available, creating a full create, read, update, and delete CMS for a single table through one command.
The end result will look something like this: The end result of the scaffold class and some extra style.
The tutorial goes through the entire process, showing the code for the different parts:
- Starting The Class
- Listing the Rows
- Creating a New Row
- Inserting the Row
- Editing a Row (Form)
- Updating The Row
- Deleting the Row