Using OIL in fuelPHP

Using OIL to generate Models, Controllers, Views, or even entire Scaffolding.

A few notes.

Quickly generate a model for albums:

[code]
oil generate model albums title:string description:text released:date image:string
[/code]

A Model for tracks…

[code]
oil generate model tracks title:string description:text album_id:int
[/code]

Generate Entire Scaffolding

Generate a complete CRUD interface for albums:

[code]
oil generate scaffold albums title:string description:text image:string
[/code]

This creates a migration, model, controller, and all views. Superb.

NOTE: Run [code]oil refine migrate[/code] afterwards, this of course runs the migration(s) file that’s generated, creating the database table(s).




No Comments


No comments yet.



Leave a Reply

Your email address will not be published. Required fields are marked *