![]() |
||
phpMyScaffoldIntroduction | Documentation (coming soon) | Download (coming soon) What is phpMyScaffold?phpMyScaffold is a tool that auto-generates web administration forms based on MySQL database tables. It is designed for use by web developers who prefer to write their own customised Content Management Systems using PHP and MySQL, but who often need a quick and easy generic way to allow their clients to update database tables. phpMyScaffold was inspired by the simplicity of Ruby on Rails' 'Scaffold' feature. Unlike RoR, however, phpMyScaffold is NOT a framework. It allows web programmers complete freedom to use their own PHP libraries and tools to create web applications the way they want to - but eases the repetitive task of creating web based admin forms. How does it work?Here is a simple of example of how you might use phpMyScaffold on a website admin page (adminpage.php):
<h1>My Client Admin Page</h1>
<a href="scaffold.php?action=create&table=articles&next_page=adminpage.php">Create new article</a><br>
<?
$articles = getArticles(); // call your function that returns all articles
foreach($articles as $a) { // loops through all articles, printing out their headline and date along with edit and delete links
?>
Headline: <?= $a[headline] ?>, Date: <?= $a[date] ?>
<a href="scaffold.php?action=update&table=articles&pk=article_id&id=<?= $a[article_id] ?>&next_page=adminpage.php">Edit article</a>
<a href="scaffold.php?action=delete&table=articles&pk=article_id&id=<?= $a[article_id] ?>&next_page=adminpage.php">Delete article</a>
<?
}
?>
The scaffold.php 'create' or 'update' page will look something like this: Click for full-size image
After the form has been correctly submitted it will redirect the user to the page in the $next_page variable The features of the generated form include:
|
||