How do I use scaffolding?

From PHP on Trax

Jump to: navigation, search

In any controller all you need to do is add a class variable $scaffold and set it equal to the name of the model you want to scaffold.



<?
class BlogScaffoldingController extends ApplicationController {
    public 
$scaffold "blog";
}    
?>

In this example blog is a model that represents a table called blogs with columns id,title,body,created_at.

example url: /blog_scaffolding

If you want to have the actual code that the scaffold is outputing and be able to edit it then all you have to do is use the generator to make it.



./generate.php scaffold modelName [controllerName] [view1 view2 ...]
Personal tools