Using OIL in fuelPHP

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

A few notes.

Quickly generate a model for albums:

oil generate model albums title:string description:text released:date image:string

A Model for tracks…

oil generate model tracks title:string description:text album_id:int

Generate Entire Scaffolding

Generate a complete CRUD interface for albums:

oil generate scaffold albums title:string description:text image:string

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).

Leave a Reply

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