We will now, as we did in Chapter 1, Building Your First FuelPHP Application and Chapter 2, Building a To-do List Application, generate the necessary code to handle our posts. Since posts should only be created and edited by authenticated administrators in an administration panel, we will generate the scaffold using admin
(alias admin/orm
):
php oil generate admin post title:string slug:string small_description:string[200] content:text category_id:int user_id:int
The command should output the following:
Creating controller: APPPATH/classes/controller/base.php Creating controller: APPPATH/classes/controller/admin.php Creating views: APPPATH/views/admin/template.php Creating views: APPPATH/views/admin/dashboard.php Creating views: APPPATH/views/admin/login.php Creating migration: APPPATH/migrations/001_create_posts.php Creating model: APPPATH/classes/model/post.php Creating controller: APPPATH/classes/controller/admin/post.php Creating view: APPPATH/views/admin/post/index...